@import "tailwindcss";

/* ==========================================================================
   Design tokens

   The gallery rule: the walls are neutral, the work supplies the colour.
   There is deliberately no global accent hue. Every colour you see on this
   site is pulled from a project's own declared palette, so the chrome never
   competes with the artwork it frames.
   ========================================================================== */

@theme {
  /* Surfaces — near-black, very slightly cool so warm artwork reads warmer */
  --color-ink: #ffffff;
  --color-ink-2: #f7f7f5;
  --color-ink-3: #efeeeb;
  --color-line: #e6e3df;
  --color-line-2: #d1ccc7;

  /* Text — warm off-white, echoing the paper stock of the printed decks.
     A cold grey here would flatten the coral and candlelight palettes. */
  --color-bone: #222222;
  --color-bone-2: #66615e;
  --color-bone-3: #8c8783;

  --font-display: var(--font-syne), ui-sans-serif, system-ui, sans-serif;
  --font-body: var(--font-archivo), ui-sans-serif, system-ui, sans-serif;

  /* Fluid type scale */
  --text-micro: 0.6875rem;
  --text-meta: 0.75rem;
  --text-body: 1rem;
  --text-lead: clamp(1.0625rem, 1rem + 0.35vw, 1.3125rem);
  --text-h3: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem);
  --text-h2: clamp(1.75rem, 1.2rem + 2.4vw, 3.25rem);
  --text-h1: clamp(2.25rem, 1.4rem + 4vw, 5rem);
  /* Sized so a three-word name still fits the shell on a wide desktop.
     Longer names wrap to more lines rather than overflowing. */
  --text-hero: clamp(2.5rem, 0.5rem + 8.5vw, 9.5rem);

  --spacing-gutter: clamp(1.25rem, 4vw, 4.5rem);
  /* The floor is what a phone gets. 5rem top and bottom stacked to a 160px
     void between every section on a small screen; 3.25rem still reads as a
     deliberate break without the page feeling half empty. */
  --spacing-section: clamp(3.25rem, 12vh, 11rem);
}

/* ==========================================================================
   Base

   These live in @layer base on purpose. Unlayered CSS beats every Tailwind
   layer regardless of specificity, so an unlayered `img { max-width: 100% }`
   would silently override `max-w-none` on the one element that needs to be
   wider than its container.
   ========================================================================== */

@layer base {
  * {
    min-width: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    background-color: var(--color-ink);
    color: var(--color-bone);
    font-family: var(--font-body);
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  ::selection {
    background: #722f3d;
    color: #ffffff;
  }

  :focus-visible {
    outline: 2px solid #722f3d;
    outline-offset: 3px;
    border-radius: 1px;
  }

  /* Keeps media from bursting its container by default. Anything that must be
     wider (a deck spread inside a horizontal scroller) opts out with
     `max-w-none`, which now works because this rule is layered. */
  img,
  svg,
  video {
    display: block;
    max-width: 100%;
  }
}

/* ==========================================================================
   Component primitives

   In @layer components so a utility class in the markup can override them —
   `class="u-prose text-[length:var(--text-body)]"` has to actually win.
   ========================================================================== */

@layer components {
  .u-display {
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }

  .u-eyebrow {
    font-size: var(--text-micro);
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--color-bone-3);
  }

  /* Curator's wall label — the descriptor beside every plate.
     Small caps title over a quiet descriptor, as on a gallery hang. */
  .u-label-title {
    font-size: var(--text-meta);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-bone);
  }

  .u-label-caption {
    font-size: var(--text-meta);
    line-height: 1.5;
    color: var(--color-bone-3);
    text-wrap: pretty;
  }

  .u-prose {
    font-size: var(--text-lead);
    line-height: 1.62;
    color: var(--color-bone-2);
    text-wrap: pretty;
  }

  .u-prose strong {
    color: var(--color-bone);
    font-weight: 500;
  }

  /* Tabular hex readouts and counters stay aligned as values change */
  .u-numeric {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
  }

  .u-shell {
    width: 100%;
    max-width: 96rem;
    margin-inline: auto;
    padding-inline: var(--spacing-gutter);
  }

  .u-rule {
    border: 0;
    border-top: 1px solid var(--color-line);
    margin: 0;
  }

  /* Anything genuinely wider than the viewport scrolls inside itself, so the
     page body never scrolls sideways. */
  .u-scroll-x {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-line-2) transparent;
  }

  .u-scroll-x::-webkit-scrollbar {
    height: 4px;
  }

  .u-scroll-x::-webkit-scrollbar-thumb {
    background: var(--color-line-2);
  }
}

/* ==========================================================================
   Motion

   One reveal, one hover behaviour, nothing else. Scattered effects are what
   make a page feel machine-assembled; a single consistent gesture reads as
   art direction.

   Left unlayered: the reveal must reliably hide content until observed, and
   no utility class competes with these selectors.
   ========================================================================== */

@keyframes u-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 1.75rem, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes u-wipe {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

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

/* Elements start hidden and are released by the observer in
   components/Reveal.tsx adding [data-shown]. If JavaScript never runs, the
   `no-js` guard below keeps everything visible. */
[data-reveal] {
  opacity: 0;
  /* Safety net for the case in between: scripting is enabled, so `no-js` was
     removed, but hydration never completed — an extension blocked the bundle,
     a runtime error, a flaky network. Without this the page would sit blank
     forever. The observed rule below outranks it on specificity, so a normal
     reveal still wins. */
  animation: u-fade 0.4s 2.5s both;
}

[data-reveal][data-shown] {
  animation: u-rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--reveal-delay, 0ms);
}

html.no-js [data-reveal] {
  opacity: 1;
}

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

  [data-reveal] {
    opacity: 1;
  }

  [data-reveal][data-shown] {
    animation: u-fade 0.01s both;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Shashi portfolio skin: quiet editorial paper, with a restrained wine accent. */
@layer base { body { background-image: radial-gradient(ellipse at 88% 8%, rgba(114,47,61,.045), transparent 28rem); } }
@layer components { .u-display { color: #222222; } .u-prose { color: #5f5a56; } }
