/* ============================================================
   ROOKH — Preeti S. Virkar
   Design system + styles.  Edit the tokens in :root to
   re-skin the whole site.  All colours are derived from the
   logo (leaf green + chocolate bark on warm paper).
   ============================================================ */

:root {
  /* ---- Colour (extended from the logo) ---- */
  --paper:        #F5EFE1;  /* base background — warm paper, not stark white */
  --paper-deep:   #ECE3CF;  /* alternate sections / cards */
  --paper-edge:   #E1D6BC;  /* hairlines, borders */
  --bark:         #5A3117;  /* headings — deep chocolate trunk */
  --bark-soft:    #7C4A2A;  /* secondary brown (wordmark tone) */
  --ink:          #33281E;  /* body text — warm near-black */
  --ink-soft:     #6B5A48;  /* muted body / captions */
  --leaf:         #35662F;  /* accent: links, rules, active */
  --leaf-bright:  #4E9E44;  /* small motif green (echoes logo leaves) */
  --leaf-wash:    #E7ECDC;  /* faint green tint for panels */

  /* ---- Type ---- */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body:    "Mulish", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --label:   "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ---- Rhythm ---- */
  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(64px, 9vw, 132px);
  --radius: 14px;
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.02rem, 0.5vw + 0.95rem, 1.15rem);
  line-height: 1.62;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--leaf); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--bark); }

/* Focus visible for keyboard users */
:focus-visible {
  outline: 2.5px solid var(--leaf);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--bark); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { left: 12px; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--tint { background: var(--paper-deep); }

/* ---------- Type scale ---------- */
h1, h2, h3 {
  font-family: var(--display);
  color: var(--bark);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  /* Fraunces optical + soft/wonk axes for the hand-drawn warmth */
  font-variation-settings: "opsz" 80, "SOFT" 40, "WONK" 1;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 5.2vw + 0.5rem, 4.4rem); }
h2 { font-size: clamp(1.9rem, 2.8vw + 0.6rem, 2.9rem); }
h3 { font-size: clamp(1.2rem, 1vw + 0.9rem, 1.5rem); font-variation-settings: "opsz" 40, "SOFT" 30, "WONK" 0; }
p  { margin: 0 0 1.1em; max-width: 65ch; }
.lead { font-size: clamp(1.15rem, 0.8vw + 1rem, 1.4rem); color: var(--ink); }

/* Specimen-tag label — the site's recurring "field data sheet" mark */
.label {
  font-family: var(--label);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--leaf);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.label::before {
  content: "";
  width: 22px; height: 1px; background: var(--leaf); opacity: 0.6;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--paper-edge);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 46px; height: auto; }
.brand__name {
  font-family: var(--display); font-weight: 600; font-size: 1.35rem;
  color: var(--bark-soft); letter-spacing: -0.01em; line-height: 1;
  font-variation-settings: "opsz" 40, "SOFT" 40, "WONK" 1;
}
.nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); }
.nav a {
  font-family: var(--label); font-size: 0.76rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
}
.nav a:hover { color: var(--leaf); }
.nav a[data-cta] {
  color: var(--bark); border: 1px solid var(--bark-soft);
  padding: 8px 14px; border-radius: 40px;
}
.nav a[data-cta]:hover { background: var(--bark); color: var(--paper); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--paper-edge);
  border-radius: 10px; padding: 9px 10px; cursor: pointer; color: var(--bark);
}
.nav-toggle svg { display: block; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--paper-edge);
    padding: 8px var(--gutter) 18px;
    clip-path: inset(0 0 100% 0); transition: clip-path 0.25s ease;
  }
  .nav.is-open { clip-path: inset(0 0 0 0); }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--paper-edge); }
  .nav a[data-cta] { margin-top: 12px; text-align: center; border-radius: 40px; }
  .nav a[data-cta]:last-child { border-bottom: none; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 92px) var(--section-y); position: relative; overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.hero__logo { justify-self: center; width: min(360px, 78%); }
.hero__logo img { width: 100%; filter: drop-shadow(0 12px 30px rgba(90,49,23,0.10)); }
.hero h1 { margin-top: 0.35em; }
.hero .lead { color: var(--ink-soft); max-width: 44ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

.btn {
  font-family: var(--label); font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  padding: 14px 24px; border-radius: 44px; display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
  border: 1px solid transparent;
}
.btn--primary { background: var(--bark); color: var(--paper); }
.btn--primary:hover { background: var(--leaf); color: #fff; transform: translateY(-2px); }
.btn--ghost { border-color: var(--bark-soft); color: var(--bark); }
.btn--ghost:hover { background: var(--paper-deep); color: var(--bark); transform: translateY(-2px); }

@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__logo { grid-row: 1; width: min(260px, 62%); margin-bottom: 8px; }
  .hero .lead { margin-inline: auto; }
  .hero__cta { justify-content: center; }
  .label { justify-content: center; }
}

/* faint line-art bee drifting in the hero corner */
.hero__bee { position: absolute; right: 4%; top: 18%; width: 88px; opacity: 0.5; color: var(--bark-soft); pointer-events: none; }
@media (max-width: 820px) { .hero__bee { display: none; } }

/* ---------- Root-line divider (signature motif) ---------- */
.rootline { display: block; width: 100%; height: 40px; color: var(--leaf-bright); opacity: 0.85; }
.rootline path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Services ---------- */
.services__head { max-width: 60ch; margin-bottom: 40px; }
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.card {
  background: var(--paper); border: 1px solid var(--paper-edge);
  border-radius: var(--radius); padding: 26px 24px 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.section--tint .card { background: var(--paper); }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(90,49,23,0.10); border-color: var(--leaf-bright); }
.card__icon { width: 34px; height: 34px; color: var(--leaf); margin-bottom: 16px; }
.card h3 { margin-bottom: 0.35em; }
.card p { color: var(--ink-soft); font-size: 0.98rem; margin-bottom: 0; }

/* ---------- Philosophy (first person) ---------- */
.philosophy__grid {
  display: grid; grid-template-columns: 1fr 0.85fr; gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.philosophy p { font-size: clamp(1.1rem, 0.6vw + 1rem, 1.32rem); color: var(--ink); }
.philosophy .label { margin-bottom: 22px; }
/* Optional portrait — falls back to a line-art panel if the image is missing */
.figure {
  border-radius: var(--radius); overflow: hidden; background: var(--leaf-wash);
  border: 1px solid var(--paper-edge); aspect-ratio: 4 / 5; position: relative;
}
.figure img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.figure__fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--leaf); padding: 24px;
}
.figure__fallback svg { width: 62%; opacity: 0.8; }
.figure img:not([src]), .figure img[src=""] { display: none; }
@media (max-width: 780px) {
  .philosophy__grid { grid-template-columns: 1fr; }
  .figure { aspect-ratio: 3 / 2; max-width: 460px; }
}

/* ---------- Proof points ---------- */
.proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--paper-edge); border: 1px solid var(--paper-edge); border-radius: var(--radius); overflow: hidden; }
.proof__item { background: var(--paper); padding: 26px 24px; }
.section--tint .proof__item { background: var(--paper-deep); }
.proof__item .label { color: var(--bark-soft); margin-bottom: 12px; }
.proof__item p { margin: 0; color: var(--ink); font-weight: 500; }
@media (max-width: 760px) { .proof { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .proof { grid-template-columns: 1fr; } }
.proof__item .sub { color: var(--ink-soft); font-weight: 400; font-size: 0.92rem; margin-top: 4px; }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(28px, 5vw, 60px); }
.contact__intro .lead { color: var(--ink-soft); }
.field { margin-bottom: 16px; }
.field label {
  display: block; font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--bark-soft); margin-bottom: 7px;
}
.field input, .field textarea {
  width: 100%; font-family: var(--body); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--paper-edge); border-radius: 10px;
  padding: 12px 14px;
}
.section--tint .field input, .section--tint .field textarea { background: var(--paper); }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--leaf); outline: none; box-shadow: 0 0 0 3px var(--leaf-wash); }
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 10px; }
@media (max-width: 780px) { .contact__grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--bark); color: #EFE1CF; padding-block: 48px 40px; }
.site-footer a { color: #EFE1CF; }
.site-footer a:hover { color: var(--leaf-bright); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 24px 40px; justify-content: space-between; align-items: flex-start; }
.site-footer .brand__name { color: #F4E9DB; }
.footer-meta { font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.08em; color: #CBB49B; line-height: 1.9; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-family: var(--label); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; }

/* =============================================================
   PORTFOLIO PAGE
   ============================================================= */
.page-head { padding-block: clamp(46px, 6vw, 84px) 0; }
.page-head h1 { max-width: 16ch; }
.page-head .lead { max-width: 56ch; color: var(--ink-soft); }
.back-link { font-family: var(--label); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; }

.prose h2 { margin-top: 0; }
.prose p, .prose h2 { max-width: 68ch; }

.creds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.cred {
  border: 1px solid var(--paper-edge); border-radius: var(--radius); padding: 22px 22px 24px; background: var(--paper);
}
.section--tint .cred { background: var(--paper-deep); }
.cred .label { margin-bottom: 10px; }
.cred strong { display: block; font-family: var(--display); font-weight: 600; color: var(--bark); font-size: 1.15rem; }
.cred span { color: var(--ink-soft); font-size: 0.94rem; }

/* Timeline — the root line runs down the left as chronology */
.timeline { position: relative; margin-top: 34px; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--leaf-bright), var(--bark-soft));
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 30px; }
.tl-item::before {
  content: ""; position: absolute; left: -33px; top: 6px; width: 12px; height: 12px;
  background: var(--paper); border: 2.5px solid var(--leaf); border-radius: 50%;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item .when { font-family: var(--label); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--leaf); }
.tl-item h3 { margin: 4px 0 4px; }
.tl-item p { color: var(--ink-soft); margin: 0; font-size: 0.98rem; }

.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 14px 0; border-bottom: 1px solid var(--paper-edge); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.list-clean li:last-child { border-bottom: none; }
.list-clean .item-t { font-weight: 600; color: var(--ink); }
.list-clean .item-m { color: var(--ink-soft); font-size: 0.92rem; }
.list-clean a { text-decoration: none; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.chip { font-family: var(--label); font-size: 0.76rem; letter-spacing: 0.06em; padding: 7px 14px; border: 1px solid var(--paper-edge); border-radius: 40px; color: var(--bark-soft); background: var(--paper); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 56px); }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

/* small utilities */
.mt-s { margin-top: 14px; } .mt-m { margin-top: 26px; } .mt-l { margin-top: 44px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }


/* ---------- Field strip (photo mosaic under the hero) ---------- */
.strip { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 10px; margin-top: 8px; }
.strip figure { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-deep); position: relative; }
.strip figure:first-child { aspect-ratio: auto; grid-row: span 1; }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.strip figure:hover img { transform: scale(1.03); }
.strip figcaption {
  position: absolute; left: 12px; bottom: 10px; font-family: var(--label); font-size: 0.66rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,0.55);
}
@media (max-width: 820px) { .strip { grid-template-columns: 1fr 1fr; } }

/* ---------- Publications & workshops (home) ---------- */
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: 16px 0; border-bottom: 1px solid var(--paper-edge); }
.pubs li:last-child { border-bottom: none; }
.pubs .pub-t { display: block; font-family: var(--display); font-weight: 600; color: var(--bark); font-size: 1.12rem; line-height: 1.25; text-decoration: none; font-variation-settings: "opsz" 40, "SOFT" 30, "WONK" 0; }
.pubs a.pub-t:hover { color: var(--leaf); }
.pubs .pub-m { display: block; color: var(--ink-soft); font-size: 0.9rem; margin-top: 4px; }
.pubs .pub-y { font-family: var(--label); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--leaf); margin-right: 8px; }

/* ---------- Photo feature (image + text) ---------- */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.feature figure { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--paper-edge); aspect-ratio: 4 / 3; }
.feature img { width: 100%; height: 100%; object-fit: cover; }
.feature figcaption { font-family: var(--label); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); padding: 10px 2px 0; }
@media (max-width: 780px) { .feature { grid-template-columns: 1fr; } }

/* ---------- Gallery (portfolio) ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery figure { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-deep); position: relative; }
.gallery figure.tall { grid-row: span 2; aspect-ratio: auto; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery figcaption { position: absolute; left: 12px; right: 12px; bottom: 10px; font-family: var(--label); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery figure.tall { grid-row: auto; aspect-ratio: 4 / 3; } }

/* ---------- Social / profile links ---------- */
.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.social a {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--label); font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
  border: 1px solid rgba(239,225,207,0.35); border-radius: 40px; padding: 8px 14px; color: #EFE1CF;
}
.social a:hover { border-color: var(--leaf-bright); color: var(--leaf-bright); }
.social svg { width: 15px; height: 15px; flex: none; }
.social--inline a { color: var(--bark); border-color: var(--paper-edge); background: var(--paper); }
.social--inline a:hover { color: var(--leaf); }

.list-clean .item-t a { color: var(--ink); }
.list-clean .item-t a:hover { color: var(--leaf); }

/* ---------- Scroll reveal (progressive enhancement) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .card:hover { transform: none; }
}
