/* slopyright.ai — zero-build stylesheet.
   Brand rules (README.md): slop green is the only accent; emphasis gets green
   or bold, never a new color. JetBrains Mono everywhere. Dark-only. */

@layer reset, tokens, base, layout, components, motion;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  img, svg { display: block; max-width: 100%; height: auto; }
  ul[class] { list-style: none; }
  html { -webkit-text-size-adjust: none; }
}

@layer tokens {
  :root {
    color-scheme: dark;

    /* palette — README.md “Color” */
    --ink: #16181D;
    --green: #4A9E5C;
    --text: #E8E6E1;
    --comment: #6B7484;
    --chrome: #2A2E37;
    --paper: #FAF7F0;
    --dot-red: #E0443E;
    --dot-yellow: #DEA123;
    --dot-green: #2FA84F;

    /* semantic */
    --bg: var(--ink);
    --fg: var(--text);
    --accent: var(--green);
    --border: var(--chrome);
    --muted: var(--comment);

    --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* fluid type scale */
    --step--1: clamp(0.78rem, 0.72rem + 0.30vw, 0.94rem);
    --step-0:  clamp(0.94rem, 0.86rem + 0.40vw, 1.13rem);
    --step-1:  clamp(1.15rem, 1.00rem + 0.75vw, 1.50rem);
    --step-2:  clamp(1.40rem, 1.15rem + 1.25vw, 2.10rem);

    --hairline: 1.5px;
  }
}

@layer base {
  body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.65;
  }
  h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
  p { text-wrap: pretty; }
  a { color: var(--accent); text-underline-offset: 0.2em; }
  a:hover { background: var(--accent); color: var(--ink); text-decoration: none; }
  ::selection { background: var(--accent); color: var(--ink); }
  .t-accent { color: var(--accent); }

  /* visually hidden, read by assistive tech — the hero h1's stable name
     while its animated spans are aria-hidden */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

@layer layout {
  .hero {
    min-height: 92svh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: clamp(1.5rem, 4vh, 2.75rem);
    padding: clamp(2rem, 6vh, 4rem) 4vw;
  }
  .section {
    width: min(68ch, 92vw);
    margin-inline: auto;
    padding-block: clamp(3rem, 9vh, 6rem);
  }
  .section > p + p { margin-top: 1.1em; }
  .section h2 { margin-bottom: 1.4em; font-size: var(--step-1); font-weight: 700; }
  .h-comment { color: var(--muted); }
  .footer {
    margin-top: clamp(3rem, 8vh, 5rem);
    border-top: var(--hairline) solid var(--border);
    display: grid;
    justify-items: center;
    gap: 1.25rem;
    padding: clamp(2.5rem, 6vh, 4rem) 4vw calc(clamp(2.5rem, 6vh, 4rem) + env(safe-area-inset-bottom));
  }
}

@layer components {
  /* ── hero terminal window — proportions match svg/primary-mark.svg
        (460-wide window: text inset 36, title bar 52, dots r6 gap 10,
        prompt em 26 → everything below scales off 1em = prompt size) ── */
  .terminal {
    width: min(46rem, 92vw);
    font-size: clamp(1.05rem, 4.9vw, 2.55rem);
    background: var(--ink);
    border: var(--hairline) solid var(--border);
    border-radius: 0.62em;
    box-shadow: 0 24px 80px rgb(0 0 0 / 0.45);
  }
  .terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.385em;
    height: 2em;
    padding-inline: 1em;
    border-bottom: var(--hairline) solid var(--border);
  }
  .dot { width: 0.46em; height: 0.46em; border-radius: 50%; }
  .dot-red { background: var(--dot-red); }
  .dot-yellow { background: var(--dot-yellow); }
  .dot-green { background: var(--dot-green); }

  .terminal-body { padding: 1.35em 1.38em 1.5em; }
  .prompt { font-size: 1em; font-weight: 400; }
  .prompt-line {
    display: flex;
    align-items: center;
    gap: 0.42em;
    min-height: 1.3em;
    white-space: nowrap;
  }
  .slopmark {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 0.88em;
    height: 0.88em;
    border: 0.069em solid var(--accent);
    border-radius: 50%;
  }
  .slopmark-s {
    color: var(--accent);
    font-size: 0.5em;
    font-weight: 700;
    line-height: 1;
  }
  .cursor {
    flex: none;
    width: 0.46em;
    height: 0.88em;
    background: var(--accent);
  }
  .comment-line {
    display: block;
    color: var(--muted);
    font-size: 0.62em;
    min-height: 1.6em;
    margin-top: 0.85em;
  }
  .tagline {
    text-align: center;
    font-size: var(--step-1);
    max-width: 34ch;
  }

  /* typing-enhancement states (toggled by js/main.js) */
  .is-hidden { display: none; }
  .is-waiting { opacity: 0; }
  .comment-line { transition: opacity 0.6s ease; }

  /* ── manifesto ── */
  .credo { margin-top: 1.4em; font-weight: 700; }

  /* ── menu cards — break out of the text column so three fit abreast ── */
  .menu {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    width: min(56rem, 92vw);
    margin-inline: calc((100% - min(56rem, 92vw)) / 2);
  }
  .card {
    border: var(--hairline) solid var(--border);
    border-radius: 12px;
    padding: 1.4rem 1.3rem;
    transition: border-color 0.25s ease, translate 0.25s ease;
  }
  .card:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    translate: 0 -3px;
  }
  .card-name { font-size: var(--step-0); font-weight: 700; }
  .card-desc { margin-top: 0.7em; color: var(--muted); font-size: var(--step--1); }

  /* ── provenance / footer ── */
  .signoff {
    margin-top: 1.6em;
    display: flex;
    align-items: center;
    gap: 0.75em;
    font-weight: 700;
  }
  .signoff .glyph { width: auto; height: 1.7em; }
  .footer-lockup { width: min(200px, 60vw); height: auto; }
  .footer-line {
    color: var(--muted);
    font-size: var(--step--1);
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    flex-wrap: wrap;
    justify-content: center;
  }
  .glyph-inline { width: auto; height: 1.05em; display: inline-block; }
}

@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }

    .cursor { animation: blink 1.1s steps(1) infinite; }
    @keyframes blink { 50% { opacity: 0; } }

    /* scroll-driven reveals — progressive: without support the content
       simply sits there fully visible */
    @supports (animation-timeline: view()) {
      .reveal {
        animation: rise-in linear both;
        animation-timeline: view();
        animation-range: entry 10% entry 60%;
      }
      @keyframes rise-in {
        from { opacity: 0.2; translate: 0 1.5rem; }
        to   { opacity: 1;   translate: 0 0; }
      }
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; }
    .comment-line { transition: none; }
    .card { transition: none; }
  }
}
