@import url('fonts.css');

/* ------------------------------------------------------------------
   TANVI PANCHAL — WORKFOLIO
   Cover page. Ultra-premium interiors, quiet-luxury palette.
   Swap --accent below to re-skin the entire architectural mark.
------------------------------------------------------------------ */

:root {
  /* Ground — off-white plaster */
  --paper:        #F7F4EE;
  --paper-warm:   #F1ECE4;
  --paper-deep:   #E8E2D8;

  /* Ink */
  --ink:          #26231F;
  --ink-soft:     #56504A;
  --ink-faint:    #9A9289;

  /* Highlight — supplied swatch (warm greige) */
  --accent:       #CBC4BB;
  --accent-mid:   #BDB4A9;
  --accent-deep:  #A79D90;

  --sans:    'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --display: 'Mirella', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --serif:   'Mirella', 'Cormorant Garamond', Georgia, serif;

  /* Mirella metrics (upem 1000) — the mark is built from the real O.
     cap 680 · O advance 720 (lsb 21 / rsb 19) · stroke 93 wide, 13.5 thin */
  --cap:      0.68;    /* cap height as a fraction of font-size */
  --track:    0.055em; /* display letter-spacing */

  --pad:    clamp(26px, 4.2vw, 74px);
  --plinth: clamp(64px, 11vh, 118px);
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
}

/* Alternate highlight — the terracotta of the reference cover.
   Switch by putting data-accent="terracotta" on the <html> tag. */
html[data-accent="terracotta"] {
  --accent:      #A9614F;
  --accent-mid:  #96513F;
  --accent-deep: #7E4234;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

html.js, html.js body { height: 100%; overflow: hidden; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------------- Stage ---------------- */

.cover {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
}

/* Plaster: broad tonal wash + fine grain */
.cover::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 78% 12%, #FFFDF9 0%, rgba(255,253,249,0) 55%),
    radial-gradient(90% 70% at 8% 88%, var(--paper-deep) 0%, rgba(232,226,216,0) 60%),
    linear-gradient(168deg, var(--paper) 0%, var(--paper-warm) 62%, var(--paper-deep) 100%);
}

.cover::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='300' height='300' filter='url(%23n)' opacity='0.35'/></svg>");
}

/* ---------------- Fluted plinth ---------------- */

.plinth {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: var(--plinth);
  overflow: hidden;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0) 0px,
      rgba(255,255,255,0) 9px,
      rgba(38,35,31,0.055) 9px,
      rgba(38,35,31,0.055) 10px
    ),
    linear-gradient(180deg, #F4F0E9 0%, #EAE4DA 100%);
  box-shadow: inset 0 1px 0 rgba(38,35,31,0.08);
}

/* ---------------- Frame furniture ---------------- */

/* ---------------- Lockup ---------------- */

/* Three columns: [ W ][ O-mark ][ RK ].
   "folio" and the discipline line start in column 2, offset past the
   column shaft — so the indent is driven by the mark, not by font metrics. */
.lockup {
  position: absolute;
  z-index: 4;
  left: var(--pad);
  top: 50%;
  transform: translateY(-52%);

  --mark: clamp(45px, 6.7vw, 104px);   /* diameter of the O */
  /* "folio" and the discipline line start exactly where RK starts:
     the mark's own advance (mark + sidebearings + one tracking unit),
     which also clears the column below. Kept in --mark units on purpose —
     an em here would resolve against each line's own font-size. */
  --indent: calc(var(--mark) * 1.14);

  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  margin: 0;

  font-family: var(--display);
  font-weight: 400;
  font-size: calc(var(--mark) / var(--cap));  /* so the ring == cap height */
  line-height: 0.86;
  letter-spacing: var(--track);
  color: var(--ink);
}

.ltr { display: block; }
.w   { grid-column: 1; grid-row: 1; }
.rk  { grid-column: 3; grid-row: 1; }

/* The O — ring capital sitting on the column.
   align-items:baseline puts its bottom margin edge on the text baseline;
   the negative margin gives the round form its optical overshoot. */
.mark {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: block;
  width: var(--mark);
  height: var(--mark);
  /* Reproduces the real O's fit: lsb 21/1000em on the left, rsb 19/1000em
     plus the tracking that a text O would carry on the right. Sits flat on
     the baseline — Mirella's O has no overshoot. */
  margin: 0 calc(0.019em + var(--track)) 0 0.021em;
}

.ring {
  position: absolute;
  inset: 0;
  /* Modulated stroke, matched to Mirella's own O: 93/680 on the sides,
     13.5/680 top and bottom. Gives the mark the same Didone contrast
     as the letters beside it. */
  border-style: solid;
  border-color: var(--accent-deep);
  border-width: calc(var(--mark) * 0.0199) calc(var(--mark) * 0.1368);
  border-radius: 50%;
  z-index: 2;
  box-shadow:
    inset 0 -2px 6px rgba(38,35,31,0.07),
    0 2px 12px rgba(38,35,31,0.05);
}

/* Column falls from the centre of the O, through the plinth, to the edge */
.column {
  position: absolute;
  /* Springs from the top of the f in "folio" — one mark height, plus the
     sub-line's margin, plus that line's ascent-to-f gap (0.08 × its size).
     Same width as the O, so the ring reads as the column's capital. */
  top: 117.2%;
  /* Dead centre on the O's axis. Its right edge then lands under the O's
     right edge, and "folio" clears it by the same gap the O keeps from R. */
  left: 50%;
  z-index: 1;
  width: var(--mark);
  height: 130vh;
  transform: translateX(-50%);
  border-radius: calc(var(--mark) * 0.5) calc(var(--mark) * 0.5) 0 0;
  /* Matte plaster, not a polished cylinder — one quiet turn of shade. */
  background:
    linear-gradient(90deg,
      var(--accent-mid) 0%,
      var(--accent) 30%,
      #DCD6CE 66%,
      var(--accent) 90%,
      var(--accent-mid) 100%);
}

.sub {
  grid-column: 2 / 4;
  grid-row: 2;
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: calc(var(--mark) * 0.90);
  line-height: 1.02;
  letter-spacing: 0.005em;
  color: var(--ink);
  padding-left: var(--indent);
  margin-top: calc(var(--mark) * 0.10);
}

.discipline {
  grid-column: 2 / 4;
  grid-row: 3;
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(11px, 1.22vw, 19px);
  line-height: 1.2;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-left: calc(var(--indent) + 0.28em);
  margin-top: calc(var(--mark) * 0.16);
}

/* ---------------- Signature (masthead) ---------------- */

.signature {
  position: absolute;
  z-index: 5;
  left: var(--pad);
  top: var(--pad);
  font-family: var(--serif);
  font-size: clamp(15px, 1.62vw, 25px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* The hairline is the signature's own underline, so it can never be
   shorter or longer than the name above it. */
.signature::after {
  content: '';
  display: block;
  width: calc(100% - 0.32em);   /* less the trailing letter-space */
  height: 1px;
  margin-top: clamp(12px, 1.5vh, 20px);
  background: var(--ink-faint);
  transform-origin: left center;
}

/* ---------------- Index ---------------- */

.index {
  position: absolute;
  z-index: 5;
  right: var(--pad);
  bottom: calc(var(--plinth) + clamp(20px, 2.6vh, 34px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(7px, 0.9vh, 12px);
  text-align: right;
}

.index a {
  position: relative;
  display: inline-block;
  padding-right: 2px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(12.5px, 1.28vw, 18px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.45s var(--ease);
}

.index a::before {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(100% + 12px);
  width: clamp(16px, 2vw, 30px);
  height: 1px;
  background: var(--accent-deep);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.5s var(--ease);
}

.index a:hover,
.index a:focus-visible { color: var(--ink); }

.index a:hover::before,
.index a:focus-visible::before { transform: scaleX(1); }

/* ---------------- Reveal ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .column {
    transform: translateX(-50%) scaleY(0);
    transform-origin: top center;
    animation: drop 1.5s var(--ease) 0.15s forwards;
  }

  .ring {
    opacity: 0;
    transform: scale(0.82);
    animation: bloom 1.1s var(--ease) 0.75s forwards;
  }

  .ltr,
  .sub,
  .discipline,
  .signature,
  .year,
  .index a {
    opacity: 0;
    transform: translateY(14px);
    animation: rise 1.05s var(--ease) forwards;
  }

  .w                        { animation-delay: 0.55s; }
  .rk                       { animation-delay: 0.66s; }
  .sub                      { animation-delay: 0.86s; }
  .discipline               { animation-delay: 1.00s; }
  .signature                { animation-delay: 1.18s; }
  .year                     { animation-delay: 1.24s; }
  .index a:nth-child(1)     { animation-delay: 1.30s; }
  .index a:nth-child(2)     { animation-delay: 1.37s; }
  .index a:nth-child(3)     { animation-delay: 1.44s; }

  .signature::after { transform: scaleX(0); animation: sweep 1.1s var(--ease) 1.32s forwards; }

  .plinth {
    clip-path: inset(0 100% 0 0);
    animation: unveil 1.6s var(--ease) 0.35s forwards;
  }
}

@keyframes drop   { to { transform: translateX(-50%) scaleY(1); } }
@keyframes bloom  { to { opacity: 1; transform: scale(1); } }
@keyframes rise   { to { opacity: 1; transform: translateY(0); } }
@keyframes sweep  { to { transform: scaleX(1); } }
@keyframes unveil { to { clip-path: inset(0 0 0 0); } }

/* ---------------- Small screens ---------------- */

@media (max-width: 720px) {
  .lockup {
    --mark: clamp(30px, 9.8vw, 56px);
    top: 46%;
  }
  .lockup { letter-spacing: 0.035em; }
  .discipline { letter-spacing: 0.30em; }
  .signature { letter-spacing: 0.22em; }
  .index { gap: 9px; }
  .index a::before { display: none; }
}

@media (max-height: 520px) {
  .lockup { --mark: clamp(44px, 9vh, 74px); }
}

/* =================================================================
   PAGE 02 — Index of work
================================================================= */

.index-page {
  position: relative;
  min-height: 100svh;
  padding: clamp(34px, 5vh, 74px) var(--pad) clamp(38px, 5.5vh, 80px);
  scroll-margin-top: 0;
  background:
    radial-gradient(110% 70% at 82% 6%, #FFFDF9 0%, rgba(255,253,249,0) 58%),
    linear-gradient(172deg, var(--paper) 0%, var(--paper-warm) 70%, var(--paper-deep) 100%);
}

/* Same plaster grain as the cover, so the two pages share a surface. */
.index-page::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='300' height='300' filter='url(%23n)' opacity='0.35'/></svg>");
}

/* The ruled box from the sketch. */
.frame {
  position: relative;
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(26px, 3.2vw, 54px) clamp(24px, 3.4vw, 62px);
  border: 1px solid rgba(38,35,31,0.16);
}

/* ---------------- Preamble ---------------- */

.preamble {
  max-width: 66ch;
  margin: 0 auto clamp(22px, 3vh, 42px);
  text-align: center;
}

.eyebrow {
  margin-bottom: clamp(14px, 2vh, 24px);
  font-family: var(--sans);
  font-size: clamp(10.5px, 1.02vw, 14px);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Sans, not Mirella: at 7:1 stroke contrast the display face loses its
   hairlines at body sizes. Mirella stays on the names and the cover. */
.lede {
  font-family: var(--sans);
  font-size: clamp(14px, 1.12vw, 18px);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

/* ---------------- Grid ---------------- */

.page-title {
  margin-bottom: clamp(10px, 1.4vh, 18px);
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(13px, 1.15vw, 17px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 6), 1fr);
  gap: clamp(10px, 1.3vw, 22px);
  list-style: none;
}

/* Each tile is a tall panel with its caption beneath, as in the reference. */
.tile a {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.shot {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: var(--paper-deep);
}

.shot img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  /* Held just off full colour so six panels read as one plate; each
     comes up to full saturation on hover. */
  filter: saturate(0.72) contrast(1.02);
  transition: transform 1.1s var(--ease), filter 0.7s var(--ease);
}

.tile a:hover .shot img,
.tile a:focus-visible .shot img {
  transform: scale(1.045);
  filter: saturate(1) contrast(1);
}

/* ---------------- Panel 06 — the drawings sheet ---------------- */

.shot--index {
  display: flex;
  align-items: flex-start;
  padding: clamp(14px, 1.5vw, 26px);
  background: var(--paper-deep);
}

.sheet-list {
  list-style: none;
  font-family: var(--sans);
  font-size: clamp(9.5px, 0.82vw, 13px);
  line-height: 1.55;
  color: var(--ink-soft);
}

.sheet-list li {
  position: relative;
  padding-left: 0.95em;
  margin-bottom: 0.45em;
}

.sheet-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-deep);
}

/* ---------------- Caption ---------------- */

.caption {
  display: block;
  padding-top: clamp(6px, 0.9vh, 12px);
  text-align: right;
}

.num {
  display: block;
  font-family: var(--display);
  font-size: clamp(26px, 2.5vw, 44px);
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.caption .name {
  display: block;
  margin-top: 0.14em;
  font-family: var(--display);
  font-size: clamp(13px, 1.18vw, 20px);
  line-height: 1.18;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.meta,
.pages {
  display: block;
  font-family: var(--sans);
  font-size: clamp(9px, 0.76vw, 12px);
  line-height: 1.5;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.meta { margin-top: 0.35em; }

.tile a:hover .caption .name,
.tile a:focus-visible .caption .name { color: var(--accent-deep); }

.tile a:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }

/* ---------------- Page 02, small screens ---------------- */

@media (max-width: 1240px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 620px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .home { letter-spacing: 0.16em; font-size: 12px; white-space: nowrap; }
  .page-nav { gap: 14px; }
  .frame { padding: clamp(22px, 6vw, 34px) clamp(16px, 4.5vw, 26px); }
}

/* =================================================================
   DECK — one view at a time, no page scrolling
================================================================= */

.js .view {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.75s var(--ease),
    transform 0.75s var(--ease),
    visibility 0s linear 0.75s;
}

.js .view.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition:
    opacity 0.75s var(--ease),
    transform 0.75s var(--ease),
    visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .js .view { transition: none; transform: none; }
}

/* The work view becomes a page that fits the screen rather than one
   that scrolls: the grid takes whatever height is left over. */
.js .index-page {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.js .index-page .frame {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.js .index-page .grid {
  flex: 1 1 auto;
  grid-template-rows: minmax(0, 1fr);   /* one row of panels, full height */
  min-height: 0;
}

.js .index-page .tile { min-height: 0; }

.js .index-page .tile a {
  height: 100%;
  aspect-ratio: auto;
}

/* ---------------- Work-view header ---------------- */

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2em;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto clamp(20px, 2.6vh, 34px);
  flex: none;
}

.home {
  font-family: var(--serif);
  font-size: clamp(13px, 1.3vw, 19px);
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.4s var(--ease);
}

.home:hover,
.home:focus-visible { color: var(--ink); }

.page-nav {
  display: flex;
  gap: clamp(16px, 2.2vw, 34px);
}

.page-nav a {
  position: relative;
  font-family: var(--sans);
  font-size: clamp(10px, 0.95vw, 13px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  padding-bottom: 4px;
  transition: color 0.4s var(--ease);
}

.page-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0.28em;
  bottom: 0;
  height: 1px;
  background: var(--accent-deep);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s var(--ease);
}

.page-nav a:hover,
.page-nav a:focus-visible { color: var(--ink); }

.page-nav a:hover::after,
.page-nav a:focus-visible::after,
.page-nav a[aria-current="page"]::after { transform: scaleX(1); }

.page-nav a[aria-current="page"] { color: var(--ink); }

/* ---------------- Staged entrance ---------------- */

@media (prefers-reduced-motion: no-preference) {
  .js .preamble,
  .js .tile {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  }
  .js .preamble.in,
  .js .tile.in { opacity: 1; transform: none; }
}

/* Below the two-column breakpoint the six tiles cannot fit a screen,
   so the view scrolls inside itself rather than the document. */
@media (max-width: 940px) {
  .js .index-page {
    display: block;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .js .index-page .frame { display: block; }
  .js .index-page .grid { grid-template-rows: none; }
  .js .index-page .shot { aspect-ratio: 1 / 2; flex: none; }
}

/* =================================================================
   PROJECT PAGE — one plate at a time
================================================================= */

.js .project {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project {
  position: relative;
  min-height: 100svh;
  padding: clamp(34px, 5vh, 74px) var(--pad) clamp(38px, 5.5vh, 80px);
  background:
    radial-gradient(110% 70% at 82% 6%, #FFFDF9 0%, rgba(255,253,249,0) 58%),
    linear-gradient(172deg, var(--paper) 0%, var(--paper-warm) 70%, var(--paper-deep) 100%);
}

.project-frame {
  display: grid;
  grid-template-columns: minmax(250px, 30%) 1fr;
  gap: clamp(24px, 3.4vw, 62px);
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

/* ---------------- Caption column ---------------- */

.project-text {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.project-num {
  font-family: var(--display);
  font-size: clamp(34px, 3.4vw, 62px);
  line-height: 1;
  color: var(--accent-deep);
}

.project-title {
  margin-top: 0.16em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(20px, 1.9vw, 34px);
  line-height: 1.15;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.project-meta {
  margin-top: 0.7em;
  font-family: var(--sans);
  font-size: clamp(9.5px, 0.8vw, 12px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.project-lede {
  margin-top: clamp(14px, 2vh, 24px);
  font-family: var(--sans);
  font-size: clamp(12.5px, 1vw, 16px);
  line-height: 1.8;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
}

/* ---------------- Plate controls ---------------- */

.plate-nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 20px);
  margin-top: auto;
  padding-top: clamp(18px, 2.4vh, 30px);
}

.plate-btn {
  width: clamp(34px, 3vw, 46px);
  height: clamp(34px, 3vw, 46px);
  border: 1px solid rgba(38,35,31,0.22);
  border-radius: 50%;
  background: transparent;
  font-family: var(--sans);
  font-size: clamp(12px, 1vw, 15px);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease), background 0.4s var(--ease);
}

.plate-btn:hover,
.plate-btn:focus-visible {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: var(--paper);
}

.plate-count {
  font-family: var(--sans);
  font-size: clamp(10px, 0.85vw, 13px);
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}

.plate-now { color: var(--ink); }

/* ---------------- Plates ---------------- */

/* No panel behind the plate. A fixed frame plus object-fit:contain leaves
   bands of a second colour around portrait shots; instead the viewer is
   transparent and each photograph sizes itself inside it, sitting on the
   plaster with a soft shadow. Nothing to letterbox. */
.plates {
  position: relative;
  min-height: 0;
  cursor: pointer;
}

.plate {
  position: absolute;
  inset: 0;
  margin: auto;               /* centres the auto-sized image both ways */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  opacity: 0;
  box-shadow: 0 14px 40px rgba(38, 35, 31, 0.13);
  transition: opacity 0.75s var(--ease);
}

.plate.is-current { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .plate { transition: none; }
}

/* ---------------- Project page, small screens ---------------- */

@media (max-width: 860px) {
  .js .project { display: block; overflow-y: auto; }
  .project-frame {
    display: block;
    flex: none;
  }
  .plates {
    aspect-ratio: 4 / 3;
    margin-top: clamp(18px, 3vh, 30px);
  }
  .plate-nav { padding-top: clamp(14px, 2vh, 22px); }
}

/* ---------------- Two-part names, feature lists, long copy ---------------- */

/* "Swajan Community / Restaurant" — the qualifier drops to its own line so
   the parent project still reads as one name across the row. */
.sub-name {
  display: block;
  font-size: 0.82em;
  color: var(--ink-soft);
}

.project-title .sub-name {
  font-size: 0.7em;
  letter-spacing: 0.05em;
  color: var(--accent-deep);
}

/* The caption column takes whatever copy a project has; the longer
   write-ups scroll within it rather than pushing the controls off. */
.project-lede {
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.9em;
  /* A hairline rail rather than a system scrollbar — the copy is part of
     the page, not a widget. */
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.project-lede::-webkit-scrollbar { width: 3px; }
.project-lede::-webkit-scrollbar-track { background: transparent; }
.project-lede::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.project-lede p + p,
.project-lede ul + p { margin-top: 0.9em; }

.feature-list {
  margin-top: 0.9em;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 0.95em;
  margin-bottom: 0.5em;
}

.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-deep);
}

.feature-list b {
  font-weight: 500;
  color: var(--ink);
}

.project-lede em {
  font-style: italic;
  color: var(--ink);
}

/* =================================================================
   GROUPED PROJECT — the chapter rail

   The rail owns the full height of the page rather than clustering at
   the top: a hairline spine runs its length, the chapters hang off it
   at even intervals, and the open one grows from a square into a
   portrait. The spine and its rings are the cover's column and O,
   brought down to index scale.
================================================================= */

.project-frame--group {
  grid-template-columns: auto minmax(230px, 25%) 1fr;
}

.chapters {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-left: clamp(20px, 1.9vw, 32px);
  list-style: none;
  min-height: 0;
}

/* The spine — fading in and out so it reads as drawn, not ruled. */
.chapters::before {
  content: '';
  position: absolute;
  left: clamp(5px, 0.5vw, 9px);
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: linear-gradient(
    180deg,
    rgba(167,157,144,0) 0%,
    var(--accent) 9%,
    var(--accent) 91%,
    rgba(167,157,144,0) 100%);
}

.chapter {
  position: relative;
  flex: none;
}

/* Ring on the spine, level with the top of each card; it fills for the
   chapter you are reading. */
.chapter::before {
  content: '';
  position: absolute;
  left: calc(clamp(20px, 1.9vw, 32px) * -1 + clamp(5px, 0.5vw, 9px) - 4px);
  top: clamp(13px, 1.5vh, 20px);
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent-deep);
  border-radius: 50%;
  background: var(--paper-warm);
  transition: background 0.5s var(--ease), transform 0.5s var(--ease);
}

.chapter:has(.is-current)::before {
  background: var(--accent-deep);
  transform: scale(1.25);
}

.chapter-btn {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.chapter-shot {
  display: block;
  position: relative;
  width: clamp(72px, 8.6vh, 116px);
  height: clamp(72px, 8.6vh, 116px);
  overflow: hidden;
  background: var(--paper-deep);
  transition: height 0.75s var(--ease);
}

/* The open chapter stands up into a portrait. */
.chapter-btn.is-current .chapter-shot {
  height: clamp(104px, 12.8vh, 172px);
}

.chapter-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.5) brightness(0.95);
  transition: filter 0.6s var(--ease);
}

.chapter-btn:hover .chapter-shot img,
.chapter-btn:focus-visible .chapter-shot img { filter: saturate(0.82) brightness(1); }
.chapter-btn.is-current .chapter-shot img    { filter: saturate(1) brightness(1); }

.chapter-index {
  display: block;
  margin-top: 0.5em;
  font-family: var(--display);
  font-size: clamp(11px, 0.95vw, 15px);
  line-height: 1;
  color: var(--ink-faint);
  transition: color 0.4s var(--ease);
}

.chapter-label {
  display: block;
  margin-top: 0.3em;
  font-family: var(--sans);
  font-size: clamp(8.5px, 0.7vw, 11px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.4s var(--ease);
}

.chapter-btn.is-current .chapter-index,
.chapter-btn.is-current .chapter-label { color: var(--ink); }
.chapter-btn:hover .chapter-label      { color: var(--ink-soft); }

.chapter-btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }

/* Only the open chapter's plates occupy the viewer. */
.plates.is-hidden { display: none; }

.chapter-copy { display: none; }
.chapter-copy.is-current { display: block; }

/* On a phone the rail becomes a single row of equal cards across the
   width — a spine and a growing card need vertical room they do not have. */
@media (max-width: 860px) {
  .chapters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(8px, 2.4vw, 16px);
    padding-left: 0;
    margin-bottom: clamp(16px, 2.6vh, 26px);
  }
  .chapters::before,
  .chapter::before { display: none; }

  .chapter-btn { width: 100%; }

  .chapter-shot,
  .chapter-btn.is-current .chapter-shot {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .chapter-btn.is-current .chapter-shot { outline: 1px solid var(--accent-deep); outline-offset: 2px; }
  .chapter-label { letter-spacing: 0.1em; line-height: 1.35; }
}

/* =================================================================
   ABOUT
================================================================= */

.js .about {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.about {
  position: relative;
  min-height: 100svh;
  padding: clamp(34px, 5vh, 74px) var(--pad) clamp(38px, 5.5vh, 80px);
  background:
    radial-gradient(110% 70% at 82% 6%, #FFFDF9 0%, rgba(255,253,249,0) 58%),
    linear-gradient(172deg, var(--paper) 0%, var(--paper-warm) 70%, var(--paper-deep) 100%);
}

.about-frame {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(230px, 30%) 1fr;
  gap: clamp(30px, 5vw, 92px);
  align-items: center;   /* the two columns sit on a shared optical centre */
  flex: 1 1 auto;
  min-height: 0;
}

/* ---------------- Left: who ---------------- */

.about-intro { min-height: 0; }

.about-name {
  margin-top: 0.1em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 3.2vw, 56px);
  line-height: 1.02;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.about-name .sub-name {
  font-size: 1em;
  color: var(--ink);
}

.about-role {
  margin-top: 0.9em;
  font-family: var(--sans);
  font-size: clamp(9.5px, 0.82vw, 12.5px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* A short ledger of facts — set as a table so the labels align. */
.about-facts {
  margin-top: clamp(22px, 3.4vh, 40px);
  border-top: 1px solid rgba(38, 35, 31, 0.14);
}

.about-facts > div {
  display: grid;
  grid-template-columns: 5.6em 1fr;
  gap: 1.2em;
  padding: clamp(8px, 1.2vh, 13px) 0;
  border-bottom: 1px solid rgba(38, 35, 31, 0.09);
}

.about-facts dt {
  font-family: var(--sans);
  font-size: clamp(8.5px, 0.7vw, 10.5px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.35em;
}

.about-facts dd {
  font-family: var(--sans);
  font-size: clamp(11px, 0.88vw, 14px);
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------------- Right: the narrative ---------------- */

.about-body {
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.9em;
  font-family: var(--sans);
  font-size: clamp(12.5px, 1vw, 16px);
  line-height: 1.85;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.about-body::-webkit-scrollbar { width: 3px; }
.about-body::-webkit-scrollbar-track { background: transparent; }
.about-body::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.about-body p + p { margin-top: 1.1em; }

/* The opening line carries the weight of a standfirst. */
.about-standfirst {
  font-family: var(--display);
  font-size: clamp(17px, 1.6vw, 27px);
  line-height: 1.42;
  letter-spacing: 0.015em;
  color: var(--ink);
  margin-bottom: 1.4em;
}

.about-quote {
  position: relative;
  margin-top: clamp(20px, 3vh, 34px);
  padding-right: clamp(16px, 1.6vw, 26px);
  border-right: 1px solid var(--accent-deep);
  text-align: right;
  font-family: var(--display);
  font-size: clamp(14px, 1.22vw, 20px);
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--ink);
}

/* ---------------- Small screens ---------------- */

@media (max-width: 860px) {
  .js .about { display: block; overflow-y: auto; }
  .about-frame { display: block; flex: none; }
  .about-body { overflow: visible; margin-top: clamp(22px, 3.5vh, 34px); }
}

/* =================================================================
   PHONE — photograph first, words underneath
================================================================= */

@media (max-width: 860px) {
  .project-frame {
    display: flex;
    flex-direction: column;
    flex: none;
  }
  .project-frame--group { display: flex; }

  .chapters     { order: 0; }
  .plates       { order: 1; }
  .project-text { order: 2; margin-top: clamp(18px, 3vh, 28px); }

  /* A fixed viewer height suits both orientations now that nothing
     is drawn behind the plate. */
  .plates {
    height: min(46vh, 70vw);
    aspect-ratio: auto;
  }

  .project-lede { overflow: visible; }
  .plate-nav { margin-top: clamp(14px, 2.4vh, 22px); padding-top: 0; }
}

/* ---------------- Sub-headings inside copy ---------------- */

.copy-head {
  margin-top: 1.4em;
  margin-bottom: 0.3em;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(9px, 0.74vw, 11.5px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.project-link { margin-top: 1.2em; }

.project-link a {
  font-family: var(--sans);
  font-size: clamp(10px, 0.8vw, 12.5px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(167, 157, 144, 0.5);
  padding-bottom: 2px;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.project-link a:hover,
.project-link a:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

/* =================================================================
   TYPED CURSOR — every write-up closes on a blinking caret
================================================================= */

.caret {
  display: inline-block;
  width: 1px;
  height: 0.95em;
  margin-left: 0.32em;
  vertical-align: -0.13em;
  background: var(--ink);
  animation: caret 1.15s steps(1) infinite;
}

@keyframes caret {
  0%, 45%  { opacity: 1; }
  50%, 95% { opacity: 0; }
  100%     { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; opacity: 0.55; }
}

/* =================================================================
   STUDIO CREDIT under each project on the index
================================================================= */

.firm {
  display: block;
  margin-top: 0.55em;
  font-family: var(--sans);
  font-size: clamp(8px, 0.66vw, 10.5px);
  line-height: 1.45;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* =================================================================
   CONTACT

   The closing page of the document, so it answers the cover: the same
   ring that forms the O of WORK returns as a mark, the same fluted
   plinth grounds the foot of the page, and the details are set as a
   colophon — centred, symmetrical, mostly air. No photograph.
================================================================= */

.js .contact {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.contact {
  position: relative;
  min-height: 100svh;
  padding: clamp(34px, 5vh, 74px) var(--pad) calc(var(--plinth) + clamp(30px, 4vh, 56px));
  background:
    radial-gradient(120% 90% at 78% 12%, #FFFDF9 0%, rgba(255,253,249,0) 55%),
    radial-gradient(90% 70% at 8% 88%, var(--paper-deep) 0%, rgba(232,226,216,0) 60%),
    linear-gradient(168deg, var(--paper) 0%, var(--paper-warm) 62%, var(--paper-deep) 100%);
}

.contact-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
}

.contact-card {
  width: 100%;
  max-width: 44em;
  text-align: center;
}

.contact-name {
  margin-top: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 76px);
  line-height: 1.0;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.contact-name .sub-name {
  display: inline;
  font-size: 1em;
  color: var(--ink);
}

.contact-role {
  margin-top: 1.15em;
  font-family: var(--sans);
  font-size: clamp(9px, 0.8vw, 12px);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Two columns divided by a hairline, like a title-page imprint. */
.contact-lines {
  display: flex;
  justify-content: center;
  align-items: stretch;
  margin-top: clamp(30px, 5vh, 62px);
  padding-top: clamp(26px, 4vh, 50px);
  border-top: 1px solid rgba(38, 35, 31, 0.16);
}

.contact-line {
  padding: 0 clamp(22px, 4vw, 62px);
  min-width: 0;
}

.contact-line + .contact-line {
  border-left: 1px solid rgba(38, 35, 31, 0.16);
}

.contact-line dt {
  font-family: var(--sans);
  font-size: clamp(8px, 0.68vw, 10px);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.9em;
}

.contact-line dd {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(13px, 1.15vw, 19px);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.contact-line a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent-deep), var(--accent-deep));
  background-repeat: no-repeat;
  background-position: 50% 100%;
  background-size: 0 1px;
  padding-bottom: 3px;
  transition: background-size 0.55s var(--ease), color 0.4s var(--ease);
  overflow-wrap: anywhere;
}

.contact-line a:hover,
.contact-line a:focus-visible {
  color: var(--accent-deep);
  background-size: 100% 1px;
}

/* The plinth belongs to the page, not the frame, so it runs edge to edge. */
.contact .plinth { z-index: 1; }
.contact .frame  { position: relative; z-index: 2; }

@media (max-width: 620px) {
  .contact-lines {
    display: block;
  }
  .contact-line {
    padding: 0;
  }
  .contact-line + .contact-line {
    border-left: 0;
    border-top: 1px solid rgba(38, 35, 31, 0.12);
    margin-top: clamp(18px, 3vh, 26px);
    padding-top: clamp(18px, 3vh, 26px);
  }
}
