/* ============================================================
   TALLO — landing system
   Self-contained. Owns the marketing page only.
   Layer order keeps specificity predictable at scale.
   ============================================================ */
@layer reset, tokens, base, components, sections, motion, responsive;

/* ---------------------------------------------------------- */
@layer tokens {
  :root {
    /* Surface — a warm near-black so aubergine reads as depth, not flat black */
    --void:        #0B0712;
    --aubergine:   #1B102B;
    --aubergine-2: #251540;
    --aubergine-3: #150C22;

    /* Ink */
    --bone:        #F7F3EA;
    --bone-2:      rgba(247, 243, 234, 0.70);
    --bone-3:      rgba(247, 243, 234, 0.46);

    /* Accents — strict discipline:
       periwinkle = action, aqua = verified proof. Nothing else. */
    --peri:        #8A8AFF;
    --peri-hi:     #A8A8FF;
    --aqua:        #C8FFFA;

    /* Structure */
    --line:        rgba(247, 243, 234, 0.12);
    --line-2:      rgba(247, 243, 234, 0.07);
    --glass:       rgba(255, 255, 255, 0.045);
    --glass-2:     rgba(255, 255, 255, 0.025);

    /* Type — Fraunces display, Manrope text. Golden-ratio scale (×1.618). */
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-text:    "Manrope", system-ui, -apple-system, Segoe UI, sans-serif;
    --font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --t-xs:   0.78rem;
    --t-sm:   0.9rem;
    --t-base: 1.02rem;
    --t-md:   1.28rem;
    --t-lg:   1.62rem;
    --t-xl:   clamp(1.9rem, 3.2vw, 2.62rem);
    --t-2xl:  clamp(2.4rem, 5vw, 4.05rem);
    --t-hero: clamp(3rem, 8.6vw, 7rem);

    /* Space — 8px base, fibonacci-ish rhythm */
    --s-1: 8px;  --s-2: 13px; --s-3: 21px; --s-4: 34px;
    --s-5: 55px; --s-6: 89px; --s-7: 144px;

    /* Form */
    --r-sm: 14px;
    --r:    24px;
    --r-lg: 32px;
    --r-pill: 999px;

    /* Motion — two curves only. Expo-out for reveal, spring for snap. */
    --ease:   cubic-bezier(0.16, 1, 0.3, 1);
    --spring: cubic-bezier(0.34, 1.4, 0.5, 1);

    /* Elevation */
    --shadow:    0 30px 80px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 50px 120px rgba(0, 0, 0, 0.55);
    --glow-peri: 0 0 90px rgba(138, 138, 255, 0.16);

    --maxw: 1200px;
  }
}

/* ---------------------------------------------------------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body { min-height: 100%; }
  img, svg { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  ul, ol { list-style: none; padding: 0; }
  button { font: inherit; }
  :focus-visible { outline: 2px solid var(--aqua); outline-offset: 3px; border-radius: 6px; }
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

/* ---------------------------------------------------------- */
@layer base {
  html { color-scheme: dark; background: var(--void); }
  body {
    font-family: var(--font-text);
    font-size: var(--t-base);
    line-height: 1.62;
    color: var(--bone);
    background: var(--void);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }

  /* Fixed atmosphere: two soft glows, a fading micro-grid, fine grain. */
  .bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
  .bg::before {
    content: ""; position: absolute; inset: 0;
    background:
      radial-gradient(60rem 50rem at 12% 100%, rgba(138, 138, 255, 0.16), transparent 70%),
      radial-gradient(46rem 40rem at 92% -5%, rgba(200, 255, 250, 0.11), transparent 70%),
      linear-gradient(180deg, var(--void), #0A0710 60%, var(--void));
  }
  .bg::after {
    content: ""; position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(247, 243, 234, 0.045) 1px, transparent 1px),
      linear-gradient(90deg, rgba(247, 243, 234, 0.045) 1px, transparent 1px);
    background-size: 88px 88px;
    mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
    -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 72%);
    opacity: 0.6;
  }

  h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
  .grad {
    background: linear-gradient(110deg, var(--peri) 10%, var(--aqua) 90%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .muted { color: var(--bone-2); }
  .mono { font-family: var(--font-mono); letter-spacing: 0.04em; font-weight: 700; }

  .eyebrow {
    font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--peri-hi);
  }

  .skip-link {
    position: fixed; top: -100px; left: 16px; z-index: 200;
    background: var(--peri); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
    transition: top 0.2s var(--ease);
  }
  .skip-link:focus { top: 16px; }
}

/* ---------------------------------------------------------- */
@layer components {
  /* Glass — one recipe, reused everywhere for material coherence */
  .glass {
    background: linear-gradient(180deg, var(--glass), var(--glass-2));
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
  }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: var(--r-pill);
    font-weight: 700; font-size: var(--t-sm); letter-spacing: 0.01em;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: transform 0.25s var(--spring), box-shadow 0.25s var(--ease),
                background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
  }
  .btn--lg { padding: 15px 26px; font-size: var(--t-base); }
  .btn--primary {
    background: var(--peri); color: #0B0712;
    box-shadow: 0 14px 34px rgba(138, 138, 255, 0.32);
  }
  .btn--primary:hover { background: var(--peri-hi); transform: translateY(-2px); box-shadow: 0 0 0 6px rgba(200, 255, 250, 0.1), 0 18px 40px rgba(138, 138, 255, 0.4); }
  .btn--line { color: var(--bone); border-color: var(--line); background: rgba(255, 255, 255, 0.02); }
  .btn--line:hover { border-color: rgba(200, 255, 250, 0.5); color: var(--aqua); transform: translateY(-2px); }
  .btn--ghost { color: var(--bone-2); }
  .btn--ghost:hover { color: var(--aqua); }

  /* Pills & signal dots */
  .pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 12px; border-radius: var(--r-pill);
    font-size: var(--t-xs); font-weight: 700;
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  }
  .pill--live { color: var(--aqua); border-color: rgba(200, 255, 250, 0.24); }
  .pill--live i {
    width: 7px; height: 7px; border-radius: 50%; background: var(--aqua);
    box-shadow: 0 0 0 0 rgba(200, 255, 250, 0.6); animation: pulse 2.4s var(--ease) infinite;
  }
  .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); flex: 0 0 auto; box-shadow: 0 0 10px rgba(200, 255, 250, 0.5); }
}

/* ---------------------------------------------------------- */
@layer sections {
  /* NAV */
  .nav {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: 14px clamp(16px, 4vw, 40px);
    background: rgba(11, 7, 18, 0.6);
    border-bottom: 1px solid var(--line-2);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  }
  .nav__brand { display: grid; gap: 1px; }
  .nav__mark { font-family: var(--font-display); font-weight: 800; font-size: 1.42rem; letter-spacing: -0.02em; }
  .nav__sub { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bone-3); }
  .nav__links { display: flex; gap: 4px; }
  .nav__links a { padding: 9px 14px; border-radius: var(--r-pill); font-size: var(--t-sm); color: var(--bone-2); transition: color 0.2s var(--ease), background 0.2s var(--ease); }
  .nav__links a:hover { color: var(--aqua); background: rgba(255, 255, 255, 0.04); }
  .nav__cta { display: flex; align-items: center; gap: var(--s-1); }

  /* layout shell */
  main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
  section { scroll-margin-top: 90px; }
  .section-head { max-width: 760px; margin: 0 auto var(--s-5); text-align: center; }
  .section-head--left { text-align: left; margin-left: 0; }
  .section-head .eyebrow { display: block; margin-bottom: var(--s-2); }
  .section-head h2 { font-size: var(--t-2xl); }
  .section-sub { margin-top: var(--s-2); color: var(--bone-2); font-size: var(--t-md); }

  /* HERO */
  .hero {
    display: grid; grid-template-columns: 1.08fr 0.92fr; gap: var(--s-5);
    align-items: center; padding: clamp(48px, 9vw, 120px) 0 var(--s-6);
  }
  .hero__copy { max-width: 620px; }
  .eyebrow + h1 { margin-top: var(--s-3); }
  .hero h1 { font-size: var(--t-hero); font-weight: 700; letter-spacing: -0.045em; }
  .lead { margin-top: var(--s-3); font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--bone-2); max-width: 38ch; }
  .hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
  .hero__alt { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--bone-3); }
  .hero__alt a { color: var(--aqua); font-weight: 700; }
  .hero__alt a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .hero__signals { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-5); }
  .hero__signals li {
    font-size: var(--t-xs); font-weight: 600; color: var(--bone-2);
    padding: 8px 13px; border-radius: var(--r-pill);
    border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02);
  }

  /* PROOF CARD — the signature object */
  .proofcard { position: relative; padding: var(--s-4); overflow: hidden; box-shadow: var(--shadow-lg), var(--glow-peri); }
  .proofcard__spot {
    position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(138, 138, 255, 0.22), transparent 60%);
    transition: opacity 0.4s var(--ease);
  }
  .proofcard:hover .proofcard__spot { opacity: 1; }

  .proofcard__head { display: flex; align-items: center; gap: var(--s-2); }
  .avatar {
    position: relative; width: 50px; height: 50px; border-radius: var(--r-sm);
    overflow: hidden; display: grid; place-items: center; flex: 0 0 auto;
    border: 1px solid var(--line); color: var(--bone-2);
  }
  .avatar__blur {
    position: absolute; inset: -30%;
    background: conic-gradient(from 200deg, #3a2a5e, #6b5a9a, #8A8AFF, #3a2a5e);
    filter: blur(9px) brightness(0.75); transform: scale(1.1);
    transition: filter 0.5s var(--ease);
  }
  .avatar__lock { position: relative; z-index: 1; }
  .proofcard:hover .avatar__blur { filter: blur(5px) brightness(0.9); }
  .proofcard__id { display: grid; gap: 1px; line-height: 1.2; }
  .proofcard__id .mono { font-size: var(--t-sm); color: var(--peri-hi); }
  .proofcard__id .muted { font-size: var(--t-xs); }
  .proofcard__head .pill { margin-left: auto; }

  .proofcard__role { margin: var(--s-3) 0; }
  .proofcard__role h3 { font-size: var(--t-xl); }
  .proofcard__role p { margin-top: 5px; font-size: var(--t-sm); }

  .proofcard__score {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  }
  .ring { transform: rotate(-90deg); flex: 0 0 auto; }
  .ring__track { fill: none; stroke: rgba(247, 243, 234, 0.1); stroke-width: 9; }
  .ring__fill {
    fill: none; stroke: url(#ringGrad); stroke-width: 9; stroke-linecap: round;
    stroke-dasharray: 327; stroke-dashoffset: 327;
    transition: stroke-dashoffset 1.1s var(--ease);
    filter: drop-shadow(0 0 6px rgba(138, 138, 255, 0.5));
  }
  .proofcard__scoreval { display: grid; gap: 2px; }
  .score { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: 1; color: var(--aqua); }
  .proofcard__scoreval .muted { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }

  .signals { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin: var(--s-3) 0; }
  .signals li { display: flex; align-items: center; gap: 9px; font-size: var(--t-sm); color: var(--bone); }

  .proofcard__foot {
    display: flex; align-items: center; gap: 8px;
    font-size: var(--t-xs); color: var(--bone-3); padding-top: var(--s-2); border-top: 1px solid var(--line);
  }
  .proofcard__tag {
    position: absolute; top: 14px; right: -34px; transform: rotate(45deg);
    background: rgba(200, 255, 250, 0.12); color: var(--aqua);
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 5px 40px; border-bottom: 1px solid rgba(200, 255, 250, 0.2);
  }

  /* ROLE RAIL */
  .rail {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: var(--s-2); padding: var(--s-4) 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
    color: var(--bone-2); font-family: var(--font-display); font-size: clamp(1rem, 2vw, 1.4rem); font-style: italic; font-weight: 500;
  }
  .rail i { color: var(--peri); font-style: normal; }

  /* HOW */
  .how { padding: var(--s-7) 0; }
  .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); counter-reset: step; }
  .step { position: relative; padding: var(--s-4); }
  .step__no { font-family: var(--font-mono); font-size: var(--t-sm); font-weight: 800; color: var(--peri); letter-spacing: 0.1em; }
  .step h3 { font-size: var(--t-lg); margin: var(--s-3) 0 var(--s-2); }
  .step p { color: var(--bone-2); font-size: var(--t-sm); }
  .step::after {
    content: ""; position: absolute; top: calc(var(--s-4) + 7px); right: calc(var(--s-3) * -1);
    width: var(--s-3); height: 1px; background: linear-gradient(90deg, var(--peri), transparent);
  }
  .step:last-child::after { display: none; }

  /* WHY / BENTO */
  .proof { padding: var(--s-6) 0; }
  .bento { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(180px, auto); gap: var(--s-3); }
  .cell {
    position: relative; padding: var(--s-4); overflow: hidden;
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  }
  .cell::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: 0;
    background: radial-gradient(20rem at 85% 0%, rgba(138, 138, 255, 0.16), transparent 70%);
    transition: opacity 0.4s var(--ease);
  }
  .cell:hover { transform: translateY(-5px); border-color: rgba(200, 255, 250, 0.28); box-shadow: var(--shadow), 0 0 0 1px rgba(200, 255, 250, 0.1); }
  .cell:hover::before { opacity: 1; }
  .cell__no { font-family: var(--font-mono); font-weight: 800; color: var(--peri); letter-spacing: 0.1em; }
  .cell h3 { font-size: var(--t-lg); margin: var(--s-3) 0 var(--s-2); position: relative; }
  .cell p { color: var(--bone-2); font-size: var(--t-sm); position: relative; }
  .cell--wide { grid-column: span 2; }
  .cell--tall { grid-row: span 2; }
  .auditline { display: grid; gap: 9px; margin-top: var(--s-4); }
  .auditline span { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: var(--t-xs); color: var(--bone-2); }
  .auditline i { width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 8px rgba(200, 255, 250, 0.6); }

  /* SECURITY */
  .security { padding: var(--s-5) 0 var(--s-6); }
  .security__inner { padding: clamp(28px, 5vw, 64px); }
  .security__inner .section-head { margin-bottom: var(--s-4); }
  .security__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
  .security__grid div { padding: var(--s-3); border-left: 1px solid var(--line); }
  .security__grid strong { display: block; color: var(--aqua); font-size: var(--t-base); margin-bottom: 6px; }
  .security__grid p { color: var(--bone-2); font-size: var(--t-sm); }

  /* START / DOORS */
  .start { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); padding: 0 0 var(--s-7); }
  .door {
    position: relative; display: grid; align-content: start; gap: var(--s-2);
    padding: clamp(28px, 4vw, 52px); overflow: hidden;
    transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  }
  .door::before {
    content: ""; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
    transition: opacity 0.5s var(--ease);
  }
  .door--client::before { background: radial-gradient(30rem at 100% 100%, rgba(138, 138, 255, 0.2), transparent 70%); }
  .door--candidate::before { background: radial-gradient(30rem at 0% 100%, rgba(200, 255, 250, 0.16), transparent 70%); }
  .door:hover { transform: translateY(-6px); border-color: rgba(200, 255, 250, 0.3); box-shadow: var(--shadow-lg); }
  .door:hover::before { opacity: 1; }
  .door__tag { font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--peri-hi); position: relative; }
  .door h3 { font-size: var(--t-xl); position: relative; }
  .door p { color: var(--bone-2); font-size: var(--t-sm); position: relative; max-width: 42ch; }
  .door__go { display: inline-flex; align-items: center; gap: 9px; margin-top: var(--s-2); color: var(--aqua); font-weight: 700; position: relative; }
  .door__go svg { transition: transform 0.3s var(--spring); }
  .door:hover .door__go svg { transform: translateX(5px); }

  /* FOOTER */
  .foot {
    max-width: var(--maxw); margin: 0 auto; padding: var(--s-5) clamp(16px, 4vw, 40px);
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
    border-top: 1px solid var(--line-2);
  }
  .foot__brand p { margin-top: 6px; color: var(--bone-3); font-size: var(--t-sm); max-width: 44ch; }
  .foot__links { display: flex; flex-wrap: wrap; gap: var(--s-1); }
  .foot__links a { padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--bone-2); font-size: var(--t-sm); transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
  .foot__links a:hover { color: var(--aqua); border-color: rgba(200, 255, 250, 0.4); }
}

/* ---------------------------------------------------------- */
@layer motion {
  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(200, 255, 250, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(200, 255, 250, 0); }
    100% { box-shadow: 0 0 0 0 rgba(200, 255, 250, 0); }
  }

  [data-reveal] {
    opacity: 0; transform: translateY(26px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  [data-reveal].in { opacity: 1; transform: none; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
    [data-reveal] { opacity: 1; transform: none; }
    .ring__fill { transition: none; }
  }
}

/* ---------------------------------------------------------- */
@layer responsive {
  @media (max-width: 940px) {
    .nav__links { display: none; }
    .hero { grid-template-columns: 1fr; gap: var(--s-5); padding-top: var(--s-5); }
    .proofcard { max-width: 460px; }
    .steps { grid-template-columns: 1fr; }
    .step::after { display: none; }
    .bento { grid-template-columns: 1fr 1fr; }
    .cell--wide { grid-column: span 2; }
    .cell--tall { grid-row: auto; }
    .security__grid { grid-template-columns: 1fr 1fr; }
  }

  @media (max-width: 600px) {
    .nav__sub { display: none; }
    .nav__cta .btn--ghost { display: none; }
    .lead { max-width: none; }
    .signals { grid-template-columns: 1fr; }
    .bento { grid-template-columns: 1fr; }
    .cell--wide { grid-column: auto; }
    .security__grid { grid-template-columns: 1fr; }
    .security__grid div { border-left: 0; border-top: 1px solid var(--line); padding: var(--s-2) 0; }
    .start { grid-template-columns: 1fr; }
    .foot { flex-direction: column; align-items: flex-start; }
    .proofcard__tag { display: none; }
  }
}
