/* understory.co.in
   Quiet Serif, from the Understory Design System.
   One bold moment (the reveal), everything else quiet. */

:root {
  --cream: #F5EFE3;
  --ivory: #FBF7EF;
  --ink: #1E1A13;
  --ink-soft: #57503F;
  --gold: #B07F35;
  --gold-deep: #8A6226;
  --sand: #E2D5BC;
  --sand-deep: #CBB98F;
  --walnut: #6B5642;
  --on-ink-soft: #CFC4AE;

  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 36rem;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --section: clamp(5rem, 12vw, 10rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Paper grain: barely there, it just takes the digital edge off the cream. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.12  0 0 0 0 0.1  0 0 0 0 0.07  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--gold-deep); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--sand); color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--cream); padding: .6rem 1rem; text-decoration: none;
}
.skip:focus { top: 1rem; }

.wrap { max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Masthead ---------- */
.masthead {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .75rem 2rem;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter);
}
.wordmark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: .16em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; font-size: .9375rem; }
.nav a { text-decoration: none; color: var(--ink-soft); padding: .25rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); }
.nav-cta { color: var(--ink) !important; border-bottom: 1px solid var(--gold); }

/* ---------- The reveal ---------- */
.reveal { position: relative; height: 210vh; }
.reveal-stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
}
.surface {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--gutter) 5rem;
  max-width: 78rem; margin: 0 auto;
  transform: translateY(calc(var(--p, 0) * -6vh));
  opacity: calc(1 - var(--p, 0) * .9);
}
.surface-line {
  font-size: min(clamp(2.75rem, 1.2rem + 6.6vw, 7rem), 12.5vh);
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 11ch;
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.surface-intro {
  max-width: 34rem;
  font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem);
  color: var(--ink-soft);
}
.scroll-cue {
  position: absolute; bottom: clamp(1.5rem, 4vh, 3rem); left: var(--gutter);
  margin: 0; font-size: .875rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: .75rem;
  opacity: calc(1 - var(--p, 0) * 4);
}
.scroll-cue::after {
  content: ""; width: 1px; height: 2.75rem; background: var(--gold);
  transform-origin: top; animation: cue 2.8s var(--ease) infinite;
}
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.under {
  position: absolute; inset: 0;
  background: var(--ink); color: var(--cream);
  transform: translateY(calc((1 - var(--p, 0)) * 100%));
  will-change: transform;
  overflow: hidden;
}
.under::before {
  /* the horizon: a single gold line where the surface ends */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
}
.under-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7rem var(--gutter) 5rem;
  max-width: 78rem; margin: 0 auto;
}
.under-line {
  font-family: var(--serif);
  font-size: min(clamp(2.75rem, 1.2rem + 6.6vw, 7rem), 12.5vh);
  line-height: 1.02; letter-spacing: -0.025em;
  font-style: italic;
  color: var(--ivory);
  margin-bottom: clamp(1.75rem, 4vw, 3rem);
}
.under-text {
  max-width: 32rem;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem);
  line-height: 1.55;
  color: var(--on-ink-soft);
  opacity: clamp(0, calc((var(--p, 0) - .35) * 2.5), 1);
}

/* No JS or reduced motion: the two layers simply stack. */
.no-reveal .reveal { height: auto; }
.no-reveal .reveal-stage { position: static; height: auto; overflow: visible; }
.no-reveal .surface,
.no-reveal .under,
.no-reveal .under-inner { position: relative; transform: none; opacity: 1; }
.no-reveal .surface { min-height: 88vh; }
.no-reveal .under { overflow: visible; }
.no-reveal .under-inner { padding-top: var(--section); padding-bottom: 0; }
.no-reveal .under-text { opacity: 1; }
.no-reveal .scroll-cue { display: none; }

/* ---------- Sections ---------- */
.section-title {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: 1.25rem;
}
.section-intro {
  max-width: var(--measure);
  font-size: clamp(1.05rem, 1rem + .25vw, 1.175rem);
  color: var(--ink-soft);
}

.wrap--split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 7rem);
}
@media (max-width: 860px) { .wrap--split { grid-template-columns: 1fr; } }

/* Lens: continues the understory, on ink */
.lens {
  background: var(--ink); color: var(--cream);
  padding: var(--section) 0 calc(var(--section) * 1.1);
}
.lens .section-intro { color: var(--on-ink-soft); }
.lens-steps {
  list-style: none; margin: clamp(3rem, 7vw, 5.5rem) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  counter-reset: step;
}
.lens-step { counter-increment: step; border-top: 1px solid rgba(203, 185, 143, .35); padding-top: 1.5rem; }
.lens-step::before {
  content: counter(step);
  display: block; font-family: var(--serif); font-style: italic;
  color: var(--gold); font-size: 1rem; margin-bottom: 1.75rem;
}
.lens-step h3 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.25rem); margin-bottom: .9rem; color: var(--ivory); }
.lens-step p { color: var(--on-ink-soft); max-width: 24rem; }
@media (max-width: 760px) { .lens-steps { grid-template-columns: 1fr; } }

/* Practice */
.practice { padding: var(--section) 0; }
.practice-list { margin: 0; }
.practice-item {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.5rem;
  padding: 1.6rem 0; border-top: 1px solid var(--sand-deep);
}
.practice-item:last-child { border-bottom: 1px solid var(--sand-deep); }
.practice-item dt { font-family: var(--serif); font-size: 1.3rem; line-height: 1.3; }
.practice-item dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 560px) { .practice-item { grid-template-columns: 1fr; gap: .4rem; } }
.strengths { margin-top: 2.25rem; max-width: var(--measure); font-family: var(--serif); font-style: italic; font-size: 1.15rem; line-height: 1.6; color: var(--walnut); }

/* Work: surface and underneath */
.work { background: var(--ivory); padding: var(--section) 0; }
.cases { list-style: none; margin: clamp(3rem, 6vw, 5rem) 0 0; padding: 0; }
.case {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(1.5rem, 5vw, 6rem);
  padding: clamp(2.25rem, 4vw, 3.25rem) 0;
  border-top: 1px solid var(--sand);
}
.case:last-child { border-bottom: 1px solid var(--sand); }
.case-brand { font-family: var(--serif); font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.4rem); line-height: 1.1; margin-bottom: .4rem; }
.case-project { color: var(--ink-soft); font-size: .95rem; max-width: 18rem; }
.layer-label {
  display: block; font-family: var(--sans); font-style: normal;
  font-size: .8125rem; letter-spacing: .02em; color: var(--gold-deep); margin-bottom: .35rem;
}
.case-surface { color: var(--ink-soft); max-width: 34rem; margin-bottom: 1.5rem; }
.case-under {
  font-family: var(--serif); font-size: clamp(1.2rem, 1.05rem + .55vw, 1.5rem); line-height: 1.45;
  max-width: 36rem; padding-left: 1.25rem; border-left: 1px solid var(--gold);
}
.case-result { margin: 1.25rem 0 0 1.25rem; font-size: .9375rem; color: var(--walnut); }
.also { margin-top: 2.5rem; color: var(--ink-soft); font-size: .95rem; }
@media (max-width: 760px) { .case { grid-template-columns: 1fr; } }

/* Sides of the table */
.sides { padding: var(--section) 0; }
.sides-text { font-family: var(--serif); font-size: clamp(1.2rem, 1.05rem + .6vw, 1.55rem); line-height: 1.5; max-width: 36rem; }
.names, .recognition { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 2.25rem; }
.names li { font-family: var(--serif); font-size: 1.2rem; color: var(--walnut); }
.recognition { margin-bottom: 2.5rem; }
.recognition li { font-size: .9375rem; color: var(--ink-soft); padding-left: 1rem; position: relative; }
.recognition li::before { content: ""; position: absolute; left: 0; top: .7em; width: .4rem; height: 1px; background: var(--gold); }

.text-link {
  display: inline-block; text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--gold); padding-bottom: .15rem; margin-right: 2rem;
}

/* Writing */
.writing { padding: var(--section) 0; border-top: 1px solid var(--sand); }
.writing--all { border-top: 0; padding-top: 0; }
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 4vw, 3.5rem); margin: clamp(2.5rem, 5vw, 4rem) 0 3rem; }
.posts--list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .posts, .posts--list { grid-template-columns: 1fr; } }
.post { border-top: 1px solid var(--ink); padding-top: 1.25rem; position: relative; }
.post-date { font-size: .8125rem; color: var(--ink-soft); margin-bottom: 1.25rem; }
.post-title { font-size: clamp(1.3rem, 1.15rem + .5vw, 1.6rem); line-height: 1.28; margin-bottom: 1rem; }
.post-title a { text-decoration: none; }
.post-title a::after { content: ""; position: absolute; inset: 0; }
.post-excerpt { color: var(--ink-soft); font-size: .975rem; }
.post-more { font-size: .875rem; font-weight: 500; color: var(--gold-deep); margin: 0; }
.post:hover .post-title { color: var(--gold-deep); }

/* Inner pages */
.page-head { padding: clamp(9rem, 18vw, 13rem) 0 clamp(3rem, 6vw, 5rem); }
.page-title { font-size: clamp(2.75rem, 1.6rem + 4.5vw, 5.5rem); line-height: 1.02; letter-spacing: -0.025em; margin-bottom: 1.75rem; }
.page-lede { font-family: var(--serif); font-size: clamp(1.25rem, 1.05rem + .9vw, 1.85rem); line-height: 1.4; max-width: 34ch; color: var(--ink); }
.prose-section { padding-bottom: var(--section); }
.prose { max-width: 38rem; }
.prose p { font-size: 1.075rem; line-height: 1.75; }
.prose h2 { font-size: clamp(1.5rem, 1.3rem + .8vw, 2rem); margin: 3rem 0 1rem; }
.prose h2:first-child { margin-top: 0; }
.portrait { margin: 0; position: sticky; top: 2rem; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.portrait--home { position: static; margin-top: 2.5rem; max-width: 20rem; }
@media (max-width: 860px) { .portrait { position: static; max-width: 22rem; } }

/* Contact */
.contact { background: var(--sand); padding: var(--section) 0; }
.contact-inner {
  max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2.5rem, 7vw, 8rem); align-items: start;
}
@media (max-width: 860px) { .contact-inner { grid-template-columns: 1fr; } }
.contact-title { font-size: clamp(2.25rem, 1.5rem + 3vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; max-width: 13ch; margin-bottom: 1.5rem; }
.contact-text { max-width: 30rem; font-size: 1.1rem; color: var(--ink-soft); margin-bottom: 2.25rem; }
.contact-small { font-size: .875rem; color: var(--walnut); margin-top: 1rem; }

.button {
  display: inline-block; font: 500 1rem/1 var(--sans); text-decoration: none;
  padding: 1.05rem 1.6rem; border: 0; border-radius: 2px; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.button--gold { background: var(--ink); color: var(--cream); box-shadow: inset 0 -2px 0 var(--gold); }
.button--gold:hover { background: var(--gold-deep); color: var(--ivory); }
.button--ink { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.button--ink:hover { background: var(--ink); color: var(--cream); }
.button[disabled] { opacity: .6; cursor: progress; }

.enquiry { background: var(--ivory); padding: clamp(1.75rem, 3vw, 2.5rem); }
.enquiry-title { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 1.5rem; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-size: .875rem; color: var(--ink-soft); margin-bottom: .4rem; }
.optional { color: var(--walnut); opacity: .8; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--sand-deep);
  padding: .5rem 0; border-radius: 0;
}
.field textarea { resize: vertical; min-height: 7rem; border: 1px solid var(--sand-deep); padding: .6rem .7rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 1px 0 var(--gold); }
.field [aria-invalid="true"] { border-color: #9B3D2E; }
.hp { position: absolute; left: -9999px; }
.enquiry-status { margin: 1rem 0 0; font-size: .9375rem; min-height: 1.5em; }
.enquiry-status.is-error { color: #9B3D2E; }
.enquiry-status.is-ok { color: var(--ink); font-family: var(--serif); font-size: 1.1rem; }

/* Footer */
.footer { background: var(--ink); color: var(--on-ink-soft); padding: 3.5rem 0; font-size: .9rem; }
.footer-inner { max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter); display: flex; flex-wrap: wrap; gap: 1rem 3rem; align-items: baseline; }
.footer .wordmark { color: var(--cream); margin: 0; }
.wordmark--small { font-size: 1rem; }
.footer-line { margin: 0; flex: 1 1 18rem; }
.footer-links { margin: 0; display: flex; gap: 1.75rem; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--gold); }

/* Reader: the real LinkedIn post, opened in place */
.reader {
  width: min(36rem, calc(100vw - 2rem)); height: min(52rem, calc(100vh - 3rem));
  padding: 0; border: 0; background: var(--ivory); color: var(--ink);
  box-shadow: 0 30px 80px rgba(30, 26, 19, .35);
}
.reader::backdrop { background: rgba(30, 26, 19, .55); backdrop-filter: blur(2px); }
.reader[open] { display: flex; flex-direction: column; animation: rise .45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(1.5rem); } to { opacity: 1; transform: none; } }
.reader-bar { display: flex; justify-content: space-between; align-items: center; padding: .85rem 1.1rem; border-bottom: 1px solid var(--sand); font-size: .9rem; }
.reader-open { text-decoration: none; border-bottom: 1px solid var(--gold); }
.reader-close { font: inherit; background: none; border: 0; cursor: pointer; color: var(--ink-soft); padding: .25rem; }
.reader-close:hover { color: var(--ink); }
.reader iframe { flex: 1; width: 100%; border: 0; background: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.page-aside {
  position: sticky; top: 2.5rem;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.3rem, 1.1rem + .8vw, 1.75rem); line-height: 1.4;
  color: var(--walnut); max-width: 16ch;
  padding-top: 1.25rem; border-top: 1px solid var(--gold);
}
.portrait + .page-aside { margin-top: 2rem; position: static; }

@media (max-height: 640px) {
  .scroll-cue { display: none; }
  .surface, .under-inner { padding-top: 5rem; padding-bottom: 2rem; }
  .surface-line, .under-line { margin-bottom: 1.25rem; }
}

/* FAQ */
.faq { padding: var(--section) 0; border-top: 1px solid var(--sand); }
.faq-item { border-top: 1px solid var(--sand-deep); }
.faq-item:last-child { border-bottom: 1px solid var(--sand-deep); }
.faq-item summary { list-style: none; cursor: pointer; padding: 1.4rem 2.5rem 1.4rem 0; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); line-height: 1.35; }
.faq-item summary::after {
  content: ""; position: absolute; right: .25rem; top: 50%; width: .75rem; height: 1px; background: var(--gold);
  box-shadow: 0 0 0 0 var(--gold);
}
.faq-item summary::before {
  content: ""; position: absolute; right: calc(.25rem + .375rem - .5px); top: calc(50% - .375rem); width: 1px; height: .75rem; background: var(--gold);
  transition: transform .3s var(--ease);
}
.faq-item[open] summary::before { transform: scaleY(0); }
.faq-item summary:hover h3 { color: var(--gold-deep); }
.faq-item p { color: var(--ink-soft); max-width: 38rem; padding-bottom: 1.5rem; margin: 0; }
