/* ════════════════════════════════════════════
   PLUTOPIA — Stylesheet
   Heritage as present rebellion.
   Dignity over spectacle.
   ════════════════════════════════════════════ */

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


/* ════════════════════════════════════════════
   RESET
   ════════════════════════════════════════════ */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  img, video { display: block; max-width: 100%; height: auto; }
  button, input { font: inherit; }
  figure { margin: 0; }
}


/* ════════════════════════════════════════════
   TOKENS
   ════════════════════════════════════════════ */
@layer tokens {
  :root {
    /* ── Color ────────────────────────────────
       Warm near-blacks, aged parchment, Han gold.
       Nothing neon. Nothing electric.
       Like old lacquerware found in a museum.
    */
    --color-bg:       #0A0805;   /* rich dark warm — aged ink, deep soil */
    --color-surface:  #14100B;   /* slightly warmer for panels */
    --color-text:     #EAE0CC;   /* parchment / aged paper */
    --color-muted:    #6B5E4A;   /* warm stone, charcoal ink */
    --color-faint:    #3A2E20;   /* for subtle borders */
    --color-accent:   #9B7830;   /* Han gold — amber of aged lacquer */
    --color-cinnabar: #A01E10;   /* traditional seal ink — deep red, not bright */

    /* ── Typography ── */
    --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

    /* ── Fluid type scale ── */
    --text-xs:      clamp(0.65rem,  1vw,   0.72rem);
    --text-sm:      clamp(0.8rem,   1.5vw, 0.9rem);
    --text-base:    clamp(0.9rem,   1.5vw, 1rem);
    --text-md:      clamp(1.1rem,   2vw,   1.3rem);
    --text-lg:      clamp(1.5rem,   3vw,   2.2rem);
    --text-xl:      clamp(2rem,     5vw,   3.5rem);
    --text-2xl:     clamp(2.5rem,   7vw,   5rem);
    --text-hero:    clamp(3.5rem,  11vw,   9rem);
    --text-statement: clamp(2.2rem, 5vw,   4.5rem);

    /* ── Spacing ── */
    --space-2xs: 0.25rem;
    --space-xs:  0.5rem;
    --space-sm:  1rem;
    --space-md:  2rem;
    --space-lg:  4rem;
    --space-xl:  7rem;
    --space-2xl: 11rem;

    /* ── Layout ── */
    --gutter:    clamp(1.25rem, 5vw, 4rem);
    --max-prose: 58ch;

    /* ── Motion ── */
    --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
    --ease-io:   cubic-bezier(0.45, 0, 0.55, 1);
    --dur-fast:  200ms;
    --dur-base:  550ms;
    --dur-slow:  850ms;
  }
}


/* ════════════════════════════════════════════
   BASE
   ════════════════════════════════════════════ */
@layer base {
  html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

  body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  ::selection {
    background: var(--color-cinnabar);
    color: var(--color-text);
  }

  a { color: inherit; text-decoration: none; }
  a:hover { color: var(--color-accent); }

  img {
    /* Warm toning on all images — like aged photographs */
    filter: grayscale(20%) sepia(12%) contrast(1.05);
    transition: filter var(--dur-slow) ease;
  }
}


/* ════════════════════════════════════════════
   COMPONENTS
   ════════════════════════════════════════════ */
@layer components {

  /* ─────────────────────────────────────────
     FILM GRAIN — the only texture we keep.
     Everything else has been stripped.
  ──────────────────────────────────────────── */
  .grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 900;
    opacity: 0.038;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
  }


  /* ─────────────────────────────────────────
     SHARED TYPOGRAPHY UTILITIES
  ──────────────────────────────────────────── */

  /* Eyebrow label — small, spaced, used above headings */
  .eyebrow {
    display: block;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-accent);
  }


  /* ─────────────────────────────────────────
     DIVIDER — diamond section mark
  ──────────────────────────────────────────── */
  .divider {
    display: flex;
    align-items: center;
    padding-inline: var(--gutter);
    height: 48px;
  }

  .divider__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right,
      transparent,
      rgba(155, 120, 48, 0.18),
      transparent
    );
  }

  .divider__mark {
    width: 6px;
    height: 6px;
    border: 1px solid rgba(155, 120, 48, 0.45);
    transform: rotate(45deg);
    margin-inline: var(--space-md);
    flex-shrink: 0;
  }


  /* ─────────────────────────────────────────
     PASSWORD GATE
     Like a private invitation — nothing more.
  ──────────────────────────────────────────── */
  .gate {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--color-bg);
    z-index: 800;
    transition: opacity var(--dur-base) var(--ease-out);
  }

  .gate.is-exiting { opacity: 0; pointer-events: none; }

  .gate__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-md);
    padding: var(--space-md);
    animation: fade-up var(--dur-slow) var(--ease-out) both;
  }

  .gate__brand {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 7vw, 3.5rem);
    font-weight: 300;
    letter-spacing: 0.35em;
    color: var(--color-text);
    line-height: 1;
  }

  .gate__sub {
    font-size: var(--text-xs);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-muted);
  }

  .gate__form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    width: min(100%, 280px);
    margin-block-start: var(--space-xs);
  }

  .gate__input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-faint);
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: var(--text-md);
    letter-spacing: 0.2em;
    padding-block: 0.6rem;
    text-align: center;
    outline: none;
    transition: border-color var(--dur-base) ease;
  }

  .gate__input::placeholder {
    font-style: italic;
    color: var(--color-muted);
    font-size: var(--text-sm);
    letter-spacing: 0.1em;
  }

  .gate__input:focus {
    border-bottom-color: var(--color-accent);
  }

  .gate__btn {
    background: transparent;
    border: none;
    color: var(--color-muted);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: var(--space-xs) 0;
    transition: color var(--dur-fast) ease;
  }

  .gate__btn:hover,
  .gate__btn:focus-visible {
    color: var(--color-text);
    outline: none;
  }

  .gate__error {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: var(--text-sm);
    color: var(--color-cinnabar);
    min-height: 1.2em;
  }


  /* ─────────────────────────────────────────
     SITE WRAPPER
  ──────────────────────────────────────────── */
  .site { min-height: 100svh; }
  .site.is-visible { animation: fade-in var(--dur-slow) var(--ease-out) both; }


  /* ─────────────────────────────────────────
     NAVIGATION
  ──────────────────────────────────────────── */
  .nav {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--gutter);
    z-index: 100;
    /* Blend keeps nav legible over any background */
    mix-blend-mode: difference;
    color: var(--color-text);
  }

  .nav__brand {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.3em;
  }

  .nav__meta {
    font-size: var(--text-xs);
    letter-spacing: 0.2em;
    opacity: 0.5;
  }


  /* ─────────────────────────────────────────
     HERO
     Full-screen photograph. Title bottom-left.
     The image is the subject — text is the caption.
  ──────────────────────────────────────────── */
  .hero {
    position: relative;
    height: 100svh;
    overflow: hidden;
  }

  .hero__bg {
    position: absolute;
    inset: 0;
  }

  .hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* More of the image visible — remove the grayscale base override */
    filter: grayscale(15%) sepia(18%) contrast(1.08) brightness(0.72);
    transition: none;
  }

  /* Gradient: dark bottom-left for text legibility, image visible top-right */
  .hero__overlay {
    position: absolute;
    inset: 0;
    background:
      linear-gradient(
        to top right,
        rgba(10, 8, 5, 0.92) 0%,
        rgba(10, 8, 5, 0.55) 45%,
        rgba(10, 8, 5, 0.15) 100%
      );
  }

  /* Title: bottom-left, editorial placement */
  .hero__content {
    position: absolute;
    inset-block-end: var(--space-xl);
    inset-inline-start: var(--gutter);
    z-index: 2;
    max-width: min(55%, 640px);
  }

  .hero__title {
    font-family: var(--font-serif);
    font-size: var(--text-hero);
    font-weight: 300;
    line-height: 0.92;
    letter-spacing: -0.01em;
    display: flex;
    flex-direction: column;
    gap: 0.06em;
  }

  .hero__line {
    display: block;
    opacity: 0;
    transform: translateY(24px);
    animation: fade-up var(--dur-base) var(--ease-out) both;
  }

  .hero__line:nth-child(1) { animation-delay: 150ms; }
  .hero__line:nth-child(2) { animation-delay: 300ms; }
  .hero__line:nth-child(3) { animation-delay: 450ms; }

  /* Italic without any color — let the typeface speak */
  .hero__line--italic { font-style: italic; }

  .hero__sub {
    margin-block-start: var(--space-md);
    font-size: var(--text-xs);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--color-muted);
    opacity: 0;
    animation: fade-up var(--dur-base) var(--ease-out) 650ms both;
  }


  /* ─────────────────────────────────────────
     STATEMENT
     One large typographic moment. No image.
     Let the words fill the room.
  ──────────────────────────────────────────── */
  .statement {
    padding: var(--space-2xl) var(--gutter);
    text-align: center;

    /* Warm ambient glow — like candlelight on stone */
    background: radial-gradient(
      ellipse at 50% 50%,
      rgba(155, 120, 48, 0.04) 0%,
      transparent 65%
    );
  }

  .statement__quote {
    font-family: var(--font-serif);
    font-size: var(--text-statement);
    font-style: italic;
    font-weight: 300;
    line-height: 1.2;
    color: var(--color-text);
    max-width: 18ch;
    margin-inline: auto;
  }

  .statement__attr {
    margin-block-start: var(--space-md);
    font-size: var(--text-xs);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-muted);
  }


  /* ─────────────────────────────────────────
     ABOUT
  ──────────────────────────────────────────── */
  .about {
    padding-block: var(--space-xl);
  }

  .about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 70svh;
  }

  .about__text {
    padding: var(--space-lg) var(--gutter);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
    border-inline-end: 1px solid rgba(155, 120, 48, 0.08);
  }

  .about__text .eyebrow {
    margin-block-end: calc(-1 * var(--space-xs));
  }

  .about__heading {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: 300;
    line-height: 1.2;
  }

  .about__heading em {
    font-style: italic;
    /* Subtle warm tint — not neon, not bright */
    color: rgba(234, 224, 204, 0.75);
  }

  .about__body {
    font-size: var(--text-sm);
    line-height: 1.9;
    color: var(--color-muted);
    max-width: var(--max-prose);
  }

  .about__image {
    overflow: hidden;
  }

  .about__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 10s ease;
  }

  .about__image:hover img {
    transform: scale(1.03);
  }


  /* ─────────────────────────────────────────
     EDITORIAL IMAGES
     Three photographs. Minimal numbered captions.
     The images speak — captions are footnotes.
  ──────────────────────────────────────────── */
  .editorial {
    padding-block: var(--space-lg);
  }

  .editorial__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: auto auto;
    gap: 2px;
    background: var(--color-bg);
  }

  .editorial__cell { overflow: hidden; position: relative; }

  .editorial__cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 10s ease;
  }

  .editorial__cell:hover img { transform: scale(1.02); }

  .editorial__cell figcaption {
    position: absolute;
    inset-block-end: 0;
    inset-inline-start: 0;
    padding: var(--space-sm);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: var(--text-xs);
    color: var(--color-muted);
    background: linear-gradient(to top, rgba(10,8,5,0.7), transparent);
    width: 100%;
  }

  /* A: large left image, spans both rows */
  .editorial__cell--a {
    grid-column: 1;
    grid-row: 1 / 3;
    aspect-ratio: unset;
    min-height: 520px;
  }

  /* B: top right */
  .editorial__cell--b {
    grid-column: 2;
    grid-row: 1;
    aspect-ratio: 4/3;
  }

  /* C: bottom right */
  .editorial__cell--c {
    grid-column: 2;
    grid-row: 2;
    aspect-ratio: 4/3;
  }


  /* ─────────────────────────────────────────
     PRODUCTS
     Info below image — editorial lookbook style.
     The photograph is the hero.
  ──────────────────────────────────────────── */
  .products {
    position: relative;
    padding-block: var(--space-lg);
    overflow: hidden;
  }

  /* Han dynasty beast — barely there, like a rubbing */
  .products__watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
    color: var(--color-text);
    opacity: 0.022;
  }

  .products__watermark svg {
    width: min(65%, 480px);
    height: auto;
  }

  .products__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding-inline: var(--gutter);
    padding-block-end: var(--space-lg);
    position: relative;
    z-index: 1;
  }

  .products__title {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: 300;
    letter-spacing: -0.01em;
  }

  /* Row 1: three equal columns */
  .products__row {
    padding-inline: var(--gutter);
    position: relative;
    z-index: 1;
  }

  .products__row--three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-block-end: var(--space-lg);
  }

  /* Row 2: two slightly wider, centred */
  .products__row--two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    max-width: 66.666%;
    margin-inline: auto;
  }

  /* Individual product item */
  .products__item {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .products__image {
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: var(--color-surface);
  }

  .products__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 8s ease;
  }

  .products__item:hover .products__image img {
    transform: scale(1.04);
  }

  /* Info below image: thin rule, then number + name */
  .products__info {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding-block: var(--space-sm);
    border-block-start: 1px solid rgba(155, 120, 48, 0.18);
    margin-block-start: var(--space-xs);
  }

  .products__num {
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    color: var(--color-cinnabar);
    padding-block-start: 0.15em; /* optical alignment with name */
    flex-shrink: 0;
  }

  .products__name {
    font-family: var(--font-serif);
    font-size: var(--text-md);
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-block-end: 0.3em;
  }

  .products__type {
    font-size: var(--text-xs);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-muted);
  }


  /* ─────────────────────────────────────────
     NOTIFY
  ──────────────────────────────────────────── */
  .notify {
    padding: var(--space-xl) var(--gutter);
  }

  .notify__inner {
    max-width: 480px;
    margin-inline: auto;
    text-align: center;
  }

  .notify__title {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: 300;
    line-height: 1.15;
    margin-block-end: var(--space-sm);
  }

  .notify__title em {
    font-style: italic;
  }

  .notify__sub {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-block-end: var(--space-md);
    line-height: 1.7;
  }

  .notify__field {
    display: flex;
    border: 1px solid var(--color-faint);
    transition: border-color var(--dur-base) ease;
  }

  .notify__field:focus-within {
    border-color: rgba(155, 120, 48, 0.45);
  }

  .notify__input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: var(--text-sm);
    font-style: italic;
    padding: 0.9rem var(--space-sm);
    outline: none;
  }

  .notify__input::placeholder {
    color: var(--color-muted);
  }

  .notify__btn {
    background: transparent;
    border: none;
    border-inline-start: 1px solid var(--color-faint);
    color: var(--color-muted);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 0.9rem var(--space-md);
    transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
    white-space: nowrap;
  }

  .notify__btn:hover,
  .notify__btn:focus-visible {
    color: var(--color-text);
    border-inline-start-color: rgba(155, 120, 48, 0.3);
    outline: none;
  }

  .notify__feedback {
    margin-block-start: var(--space-sm);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: var(--text-sm);
    color: var(--color-accent);
    min-height: 1.2em;
  }


  /* ─────────────────────────────────────────
     FOOTER
  ──────────────────────────────────────────── */
  .footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-md) var(--gutter);
    border-block-start: 1px solid rgba(155, 120, 48, 0.08);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    color: var(--color-muted);
  }

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

} /* end @layer components */


/* ════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════ */
@layer utilities {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition:
      opacity  var(--dur-slow) var(--ease-out),
      transform var(--dur-slow) var(--ease-out);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ════════════════════════════════════════════
   KEYFRAMES
   ════════════════════════════════════════════ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr;
  }

  .about__text {
    border-inline-end: none;
    border-block-end: 1px solid rgba(155, 120, 48, 0.08);
    padding: var(--space-md) var(--gutter);
  }

  .about__image {
    aspect-ratio: 4/3;
  }

  .editorial__grid {
    grid-template-columns: 1fr;
  }

  .editorial__cell--a { grid-column: 1; grid-row: 1; min-height: 300px; }
  .editorial__cell--b { grid-column: 1; grid-row: 2; }
  .editorial__cell--c { grid-column: 1; grid-row: 3; }

  .products__row--three {
    grid-template-columns: 1fr 1fr;
  }

  /* Coat goes full width on small screens */
  .products__row--three .products__item:nth-child(2) {
    grid-column: 1 / -1;
  }

  .products__row--two {
    max-width: 100%;
  }

  .hero__content {
    max-width: 85%;
    inset-block-end: var(--space-lg);
  }

  .footer {
    flex-direction: column;
    text-align: center;
  }

  .notify__field {
    flex-direction: column;
  }

  .notify__btn {
    border-inline-start: none;
    border-block-start: 1px solid var(--color-faint);
    padding-block: var(--space-sm);
  }
}

@media (max-width: 480px) {
  .products__row--three {
    grid-template-columns: 1fr;
  }

  .products__row--three .products__item:nth-child(2) {
    grid-column: 1;
  }
}


/* ════════════════════════════════════════════
   REDUCED MOTION
   ════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__line,
  .hero__sub,
  .gate__inner { opacity: 1; transform: none; }
}
