@layer reset, theme, base, components, utilities;

*, *::before, *::after { box-sizing: border-box; }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.field__error[hidden] { display: none; }

/* ============================================================
   Noman Hosni / Grinder - editorial black & white landing page
   Self-hosted fonts: Cormorant Garamond (display) + Archivo (UI)
   ============================================================ */

:root {
  --paper: #fafafa;
  --paper-dim: #f1f1f1;
  --ink: #0a0a0a;
  --ink-soft: #262626;
  --grey-600: #565656;
  --grey-500: #6e6e6e;
  --grey-400: #8a8a8a;
  --grey-on-dark: #a3a3a3;
  --hairline: rgba(10, 10, 10, 0.14);
  --hairline-strong: rgba(10, 10, 10, 0.28);
  --hairline-dark: rgba(250, 250, 250, 0.16);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-ui: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --content: min(1160px, 100% - clamp(40px, 9vw, 112px));
  --content-narrow: min(740px, 100% - clamp(40px, 9vw, 112px));
}

@layer base {
  html {
    background: var(--paper);
    color: var(--ink);
    color-scheme: light;
    scroll-behavior: smooth;
  }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  img {
    max-width: 100%;
    display: block;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  ::selection {
    background: var(--ink);
    color: var(--paper);
  }

  :focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
  }

  .on-dark :focus-visible {
    outline-color: var(--paper);
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }
}

@layer components {
  .container {
    width: var(--content);
    margin-inline: auto;
  }

  /* ------------------------------------------------------------------
     Entrance motion - fires ON MOUNT (screenshot-safe), transform +
     opacity only, fully gated by prefers-reduced-motion.
     ------------------------------------------------------------------ */
  .rise {
    opacity: 0;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes lineUp {
    to {
      transform: translateY(0);
    }
  }

  @keyframes drawX {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .rise {
      animation: rise 1s var(--ease-out) both;
    }
    .rise-d1 { animation-delay: 0.1s; }
    .rise-d2 { animation-delay: 0.22s; }
    .rise-d3 { animation-delay: 0.36s; }
    .rise-d4 { animation-delay: 0.52s; }

    .mask-line {
      display: block;
      overflow: hidden;
      padding-bottom: 0.08em; /* serif cap clearance */
    }
    .mask-line > span {
      display: block;
      transform: translateY(115%);
      animation: lineUp 1.1s var(--ease-out) both;
    }
    .mask-line-2 > span {
      animation-delay: 0.16s;
    }

    .hero-rule {
      transform-origin: center;
      animation: drawX 1.2s var(--ease-out) 0.35s both;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .rise,
    .mask-line > span {
      opacity: 1;
      transform: none;
      animation: none;
    }
  }

  /* ------------------------------------------------------------------
     Header
     ------------------------------------------------------------------ */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(250, 250, 250, 0.88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hairline);
  }

  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
  }

  .wordmark {
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
  }

  .site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
  }

  .site-nav a {
    position: relative;
    padding: 6px 0;
    font-family: var(--font-ui);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey-500);
    transition: color 0.25s ease;
  }

  .site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 100%;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease-out);
  }

  .site-nav a:hover {
    color: var(--ink);
  }

  .site-nav a:hover::after {
    transform: scaleX(1);
  }

  /* ------------------------------------------------------------------
     Hero (editorial manifesto)
     ------------------------------------------------------------------ */
  .hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100dvh - 68px);
    padding: clamp(64px, 11vh, 128px) 0 clamp(80px, 11vh, 128px);
    text-align: center;
  }

  .hero-inner {
    width: var(--content-narrow);
    margin-inline: auto;
  }

  .hero-rule {
    width: 56px;
    height: 1px;
    background: var(--ink);
    margin: 0 auto clamp(40px, 6vh, 64px);
  }

  .hero-brand {
    margin: 0 0 36px;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
  }

  .hero-title {
    margin: 0 0 clamp(28px, 4.5vh, 48px);
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3.3rem, 11vw, 8.4rem);
    line-height: 1;
    letter-spacing: -0.015em;
  }

  .hero-sub {
    margin: 0 auto clamp(40px, 6vh, 60px);
    max-width: 42ch;
    font-family: var(--font-ui);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.8;
    color: var(--grey-600);
  }

  .form-intro {
    margin: 0 0 26px;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(1.3rem, 2.6vw, 1.55rem);
    line-height: 1.35;
  }

  .signup {
    max-width: 460px;
    margin: 0 auto;
    text-align: left;
  }

  .signup__row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
  }

  .field {
    flex: 1 1 auto;
    min-width: 0;
  }

  .field__label {
    display: block;
    margin-bottom: 10px;
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--grey-500);
  }

  .field__input {
    width: 100%;
    padding: 10px 2px 12px;
    border: 0;
    border-bottom: 1px solid var(--hairline-strong);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    transition: border-color 0.25s ease;
  }

  .field__input::placeholder {
    color: var(--grey-400);
  }

  .field__input:focus {
    outline: none;
    border-bottom-color: var(--ink);
  }

  .field__error {
    display: block;
    margin-top: 10px;
    font-family: var(--font-ui);
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #a03131;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 54px;
    padding: 0 30px;
    border: 0;
    border-radius: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.15s ease;
  }

  .btn:hover {
    background: var(--ink-soft);
  }

  .btn:active {
    transform: scale(0.98);
  }

  .btn:disabled {
    opacity: 0.55;
    cursor: default;
  }

  .reassurance {
    margin-top: 18px;
    font-family: var(--font-ui);
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--grey-400);
  }

  .form-done {
    padding: 30px 0 8px;
    text-align: center;
  }

  .form-done__line {
    width: 40px;
    height: 1px;
    margin: 0 auto 22px;
    background: var(--ink);
  }

  .form-done__msg {
    margin: 0;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 1.5rem;
    line-height: 1.45;
  }

  /* ------------------------------------------------------------------
     Statement section
     ------------------------------------------------------------------ */
  .statement {
    padding: clamp(96px, 14vh, 168px) 0;
    border-top: 1px solid var(--hairline);
  }

  .statement__title {
    margin: 0 0 48px;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.5rem, 7vw, 5.7rem);
    line-height: 1.04;
    letter-spacing: -0.012em;
  }

  .statement__title em {
    font-style: italic;
  }

  .statement__body {
    margin: 0;
    max-width: 40ch;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.9;
    color: var(--grey-600);
  }

  /* ------------------------------------------------------------------
     Material band (generated abstract B&W plate)
     ------------------------------------------------------------------ */
  .material {
    position: relative;
    overflow: hidden;
    height: clamp(300px, 52vw, 560px);
    background: var(--paper-dim);
  }

  .material img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  @keyframes drift {
    from {
      translate: 0 -3%;
    }
    to {
      translate: 0 3%;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .material img {
        scale: 1.16;
        animation: drift linear both;
        animation-timeline: view();
        animation-range: entry 0% exit 100%;
      }
    }
  }

  /* ------------------------------------------------------------------
     Projet section
     ------------------------------------------------------------------ */
  .projet {
    position: relative;
    overflow: hidden;
    padding: clamp(96px, 14vh, 168px) 0 clamp(104px, 15vh, 176px);
  }

  .ghost {
    position: absolute;
    top: 4%;
    left: -1vw;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(7rem, 24vw, 24rem);
    line-height: 0.85;
    letter-spacing: -0.02em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(10, 10, 10, 0.1);
    white-space: nowrap;
  }

  @keyframes ghostDrift {
    from {
      translate: 0 7%;
    }
    to {
      translate: 0 -7%;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .ghost {
        animation: ghostDrift linear both;
        animation-timeline: view();
        animation-range: entry 0% exit 100%;
      }
    }
  }

  .projet__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: clamp(40px, 6vw, 88px);
    align-items: start;
  }

  .projet__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    line-height: 1.05;
  }

  .projet__copy {
    margin: 0 0 clamp(40px, 5vh, 56px);
    max-width: 46ch;
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.9;
    color: var(--grey-600);
  }

  .projet__frame {
    margin: 0;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 1px solid var(--hairline);
    background: var(--paper-dim);
    text-align: center;
  }

  .projet__frame-caption {
    max-width: 24ch;
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.2em;
    line-height: 1.9;
    text-transform: uppercase;
    color: var(--grey-400);
  }

  .spec-rows {
    position: relative;
    z-index: 1;
    margin-top: clamp(72px, 10vh, 120px);
  }

  .spec-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    padding: 26px 0;
    border-top: 1px solid var(--hairline);
  }

  .spec-row__key {
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--grey-500);
  }

  .spec-row__value {
    font-family: var(--font-ui);
    font-size: 15px;
    text-align: right;
  }

  /* ------------------------------------------------------------------
     Finale (black, inverted signup)
     ------------------------------------------------------------------ */
  .finale {
    position: relative;
    overflow: hidden;
    padding: clamp(120px, 16vh, 200px) 0 clamp(112px, 15vh, 176px);
    background: var(--ink);
    color: var(--paper);
    text-align: center;
  }

  .finale__texture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    pointer-events: none;
  }

  .finale__inner {
    position: relative;
    z-index: 1;
    width: var(--content-narrow);
    margin-inline: auto;
  }

  .finale__title {
    margin: 0 0 clamp(44px, 6vh, 64px);
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(2.4rem, 6.4vw, 5.2rem);
    line-height: 1.04;
    letter-spacing: -0.01em;
  }

  /* dark variant of the signup form */
  .on-dark .field__label {
    color: var(--grey-on-dark);
  }

  .on-dark .field__input {
    border-bottom-color: rgba(250, 250, 250, 0.32);
    color: var(--paper);
  }

  .on-dark .field__input:focus {
    border-bottom-color: var(--paper);
  }

  .on-dark .field__error {
    color: #ffb3b3;
  }

  .on-dark .btn {
    background: var(--paper);
    color: var(--ink);
  }

  .on-dark .btn:hover {
    background: #d9d9d9;
  }

  .on-dark .form-done__line {
    background: var(--paper);
  }

  /* ------------------------------------------------------------------
     Footer
     ------------------------------------------------------------------ */
  .site-footer {
    background: var(--ink);
    color: var(--paper);
    padding: 44px 0 56px;
    border-top: 1px solid var(--hairline-dark);
  }

  .site-footer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 40px;
  }

  .site-footer .wordmark {
    color: var(--paper);
  }

  .footer-links {
    display: flex;
    align-items: center;
    gap: 26px;
  }

  .footer-links a {
    font-family: var(--font-ui);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey-on-dark);
    transition: color 0.25s ease;
  }

  .footer-links a:hover {
    color: var(--paper);
  }

  .footer-links a.is-placeholder {
    color: var(--grey-500);
    cursor: default;
  }

  .footer-links a.is-placeholder:hover {
    color: var(--grey-500);
  }

  .site-footer__bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 22px;
    border-top: 1px solid var(--hairline-dark);
    font-family: var(--font-ui);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--grey-400);
  }

  /* ------------------------------------------------------------------
     Responsive
     ------------------------------------------------------------------ */
  @media (max-width: 900px) {
    .projet__grid {
      grid-template-columns: 1fr;
      gap: 40px;
    }
    .site-nav {
      gap: 20px;
    }
  }

  @media (max-width: 640px) {
    .site-header__inner {
      height: 60px;
    }
    .site-nav {
      gap: 16px;
    }
    .site-nav a {
      letter-spacing: 0.1em;
    }
    .signup__row {
      flex-direction: column;
      align-items: stretch;
    }
    .btn {
      width: 100%;
      height: 56px;
    }
    .spec-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
    }
    .spec-row__value {
      text-align: left;
    }
    .site-footer__top {
      flex-direction: column;
      align-items: flex-start;
      gap: 18px;
    }
    .site-footer__bottom {
      flex-direction: column;
      gap: 8px;
    }
  }
}
@layer components {
  .privacy-note {
    padding: clamp(44px, 6vw, 84px) 0;
    border-top: 1px solid var(--hairline);
    background: var(--paper-dim);
    scroll-margin-top: 68px;
  }
  .privacy-note h2 {
    margin: 0 0 12px;
    font: 400 clamp(30px, 4vw, 44px)/1.1 var(--font-display);
  }
  .privacy-note p {
    max-width: 680px;
    margin: 0;
    color: var(--grey-600);
  }
  .privacy-note a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
