/* DCLAIR Studio — site styles
   Brand colour is still undecided: change --accent to update it everywhere. */

:root {
  --paper: #ffffff;
  --ink: #0d0d0f;
  --muted: #6d6b66;
  --rule: rgba(13, 13, 15, 0.14);
  --accent: #2a36e8; /* placeholder: luminous blue, swap once colour is decided */

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: none; /* full-bleed, aligned with the header */
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

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

/* ---------- Labels: the "engineered" layer ---------- */
.label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Header: name top-left, About text blurs in on hover ---------- */
.site-header {
  --head-size: clamp(19px, 2.3vw, 34px);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: clamp(18px, 2.4vw, 30px) var(--gutter);
  font-family: var(--sans);
  font-size: var(--head-size);
  line-height: 1.16;
  letter-spacing: -0.012em;
  pointer-events: none;
}

/* Soft paper veil that blurs the page behind the open text */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -48px 0;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--paper) 92%, transparent) 70%,
    color-mix(in srgb, var(--paper) 0%, transparent));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: -1;
}
.site-header.is-open::before { opacity: 1; }

.intro {
  max-width: 31em;
  margin: 0;
}
.intro-name {
  pointer-events: auto;
  text-decoration: none;
  white-space: nowrap;
  cursor: default;
}
a.intro-name[href] { cursor: pointer; }
.intro-name b { font-weight: 600; letter-spacing: 0.02em; }

.intro-text { pointer-events: none; }
.site-header.is-open .intro-text { pointer-events: auto; }

.intro-text .w {
  display: inline-block;
  opacity: 0;
  filter: blur(12px);
  transform: translateY(0.08em);
  transition:
    opacity 0.35s ease,
    filter 0.4s ease,
    transform 0.4s ease;
  will-change: filter, opacity;
}
.site-header.is-open .intro-text .w {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition:
    opacity 0.9s ease,
    filter 1.1s cubic-bezier(.2, .7, .2, 1),
    transform 1.1s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(var(--i) * 16ms);
}

.nav {
  display: flex;
  gap: 0.75em;
  pointer-events: auto;
  white-space: nowrap;
}
.nav a {
  text-decoration: none;
  transition: opacity 0.2s;
}
.nav a:hover { opacity: 0.55; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 0.16em; }

/* Inner pages leave room for the header */
.page main { padding-top: clamp(64px, 8vw, 110px); }

/* ---------- Home: full-screen opening ---------- */
.opening {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
}

.opening-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: clamp(18px, 2.4vw, 30px) var(--gutter);
}
.opening-foot .tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  margin: 0;
}

/* ---------- Sections ---------- */
section { border-bottom: 1px solid var(--rule); }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 12vw, 160px) 0 clamp(48px, 8vw, 104px); }

.display {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7.4vw, 7rem);
  line-height: 1.0;
  letter-spacing: -0.015em;
  margin: 28px 0 0;
  max-width: 14em;
}
.display em { font-style: italic; }

/* Hand-drawn mark: the "hand-made" layer */
.drawn {
  position: relative;
  white-space: nowrap;
  display: inline-block;
}
.drawn svg {
  position: absolute;
  left: -6%;
  top: -14%;
  width: 112%;
  height: 128%;
  overflow: visible;
  pointer-events: none;
}
.drawn path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.drawn svg {
  clip-path: inset(-20% 100% -20% -2%);
  animation: draw 1.4s cubic-bezier(.6, .1, .2, 1) 0.5s forwards;
}
.drawn.under svg { top: auto; bottom: -0.28em; height: 0.4em; left: -2%; width: 104%; }

@keyframes draw { to { clip-path: inset(-20% -2% -20% -2%); } }

.hero-foot {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: clamp(48px, 8vw, 96px);
  align-items: end;
}
.hero-foot .tagline {
  grid-column: 1 / span 5;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1.2;
  margin: 0;
}
.hero-foot .lede {
  grid-column: 7 / span 6;
  margin: 0;
  max-width: 34em;
}

/* ---------- Fade-in ---------- */
.rise { opacity: 0; transform: translateY(14px); animation: rise 1s cubic-bezier(.2, .7, .2, 1) forwards; }
.rise.d1 { animation-delay: 0.15s; }
.rise.d2 { animation-delay: 0.35s; }
.rise.d3 { animation-delay: 0.55s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Practice areas ---------- */
.practice { padding-bottom: clamp(56px, 9vw, 120px); }
.practice-list {
  list-style: none;
  margin: clamp(24px, 5vw, 56px) 0 0;
  padding: 0;
}
.practice-list li {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding: clamp(14px, 2vw, 22px) 0;
}
.practice-list li:last-child { border-bottom: 1px solid var(--rule); }
.practice-list .word {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 6rem);
  letter-spacing: -0.035em;
  line-height: 1;
  text-transform: uppercase;
}
.practice .note {
  margin: 28px 0 0 64px;
  max-width: 30em;
  color: var(--muted);
}

/* ---------- Method ---------- */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-left: 1px solid var(--rule);
  margin-bottom: clamp(56px, 9vw, 120px);
}
.method-grid > div {
  border-right: 1px solid var(--rule);
  padding: 20px 20px 0;
  min-height: clamp(180px, 24vw, 300px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.method-grid p {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  line-height: 1;
  margin: 0 0 20px;
}

/* ---------- Statement / quote ---------- */
.statement { padding: clamp(64px, 12vw, 160px) 0; }
.statement p {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.06;
  max-width: 16em;
  margin: 24px 0 0;
}
.statement p em { font-style: italic; }

/* ---------- Prose ---------- */
.prose-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: clamp(56px, 9vw, 120px);
}
.prose-grid .side { grid-column: 1 / span 4; }
.prose-grid .main { grid-column: 6 / span 7; }
.prose-grid .main p {
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.5;
  margin: 0 0 1em;
  max-width: 32em;
}
.prose-grid .main p:last-child { margin-bottom: 0; }

/* Name story, set like a dictionary entry */
.entry { margin: 0 0 clamp(28px, 4vw, 44px); }
.entry dt {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  line-height: 1;
}
.entry dt i { font-style: italic; }
.entry dt small {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-left: 12px;
  vertical-align: middle;
}
.entry dd { margin: 10px 0 0; font-size: 1.15rem; max-width: 30em; }

/* ---------- Values ---------- */
.values { list-style: none; margin: 0; padding: 0; }
.values li {
  display: grid;
  grid-template-columns: 64px minmax(0, 5fr) minmax(0, 6fr);
  gap: 24px;
  align-items: baseline;
  border-top: 1px solid var(--rule);
  padding: clamp(18px, 3vw, 32px) 0;
}
.values li:last-child { border-bottom: 1px solid var(--rule); }
.values h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  margin: 0;
}
.values .src { display: block; margin-top: 10px; }
.values p { margin: 0; font-size: 1.1rem; max-width: 28em; }

/* ---------- Manifesto ---------- */
.manifesto { padding: clamp(56px, 10vw, 140px) 0; }
.manifesto ol { list-style: none; margin: 28px 0 0; padding: 0; }
.manifesto li {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.8rem, 5.2vw, 4.6rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.manifesto li em {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
}

/* ---------- Contact / CTA ---------- */
.cta { padding: clamp(64px, 12vw, 160px) 0; }
.cta h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  line-height: 1;
  margin: 24px 0 clamp(28px, 4vw, 48px);
}
.cta h2 em { font-style: italic; }

.email {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.2rem, 2.6vw, 2rem);
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 4px;
  word-break: break-all;
}
.email .arrow { transition: transform 0.25s; }
.email:hover .arrow { transform: translateX(6px); }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: clamp(56px, 9vw, 120px);
}
.contact-grid > div { grid-column: span 4; }
.contact-grid p { margin: 10px 0 0; font-size: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer { padding: 28px 0 40px; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .intro { max-width: none; }
  .hero-foot .tagline,
  .hero-foot .lede { grid-column: 1 / -1; }
  .practice-list li { grid-template-columns: 40px 1fr; }
  .practice .note { margin-left: 40px; }
  .method-grid { grid-template-columns: 1fr; border-left: 0; }
  .method-grid > div {
    border-right: 0;
    border-top: 1px solid var(--rule);
    min-height: 0;
    padding: 18px 0 0;
    flex-direction: row;
    align-items: baseline;
    gap: 20px;
  }
  .method-grid > div:last-child { border-bottom: 1px solid var(--rule); }
  .prose-grid .side,
  .prose-grid .main { grid-column: 1 / -1; }
  .values li { grid-template-columns: 40px 1fr; }
  .values p { grid-column: 2; }
  .contact-grid > div { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; animation: none; }
  .drawn svg { animation: none; clip-path: none; }
  .intro-text .w,
  .site-header.is-open .intro-text .w { transition: opacity 0.3s ease; filter: none; transform: none; }
}

/* Hand-drawn marks wait until they scroll into view */
.drawn svg { animation-play-state: paused; }
.in-view .drawn svg { animation-play-state: running; }
.hero-foot .lede { grid-column: 1 / span 6; }
@media (max-width: 760px) { .hero-foot .lede { grid-column: 1 / -1; } }

/* Source Serif 4: set upright and light, no italics */
.display, .statement p, .cta h2, .manifesto li em, .entry dt, .values h3, .tagline, .method-grid p {
  font-weight: 300;
  letter-spacing: -0.02em;
}
.display em, .statement p em, .cta h2 em, .manifesto li em,
.entry dt i, .values h3 em, .method-grid p em, .tagline, .drawn em { font-style: normal; }
.tagline { letter-spacing: -0.01em; }
.opening-foot .tagline, .hero-foot .tagline { font-style: normal; font-weight: 300; }

/* Small legal line and footer: the secondary serif, small and light grey */
.legal {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  letter-spacing: -0.01em;
  color: #9a9893;
  text-decoration: none;
}
.opening-foot { align-items: baseline; }
a.legal:hover { color: var(--ink); }

/* no rule under the last section of a page */
main > section:last-child { border-bottom: 0; }

@media (max-width: 760px) {
  .opening-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .legal { white-space: nowrap; }
}

@keyframes blob-shift {
  0%, 100% { border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%; rotate: 0deg; }
  50% { border-radius: 56% 44% 52% 48% / 46% 56% 44% 54%; rotate: 4deg; }
}
@media (prefers-reduced-motion: reduce) {
}

/* keep the blob from causing sideways scroll on small screens */
html, body { overflow-x: clip; }

/* ---------- Blur in, then a prism passes ----------
   1. Words blur in one by one (no colour).
   2. Once all the text is in, a prismatic band of colour fringes and slight blur
      passes across it horizontally (left to right, all lines at once), then clears.
   script.js sets --x (each word's position across the block, 0 to 1) and
   --t0 (when the blur-in has finished). */
@keyframes blur-in {
  0% { opacity: 0; filter: blur(12px); transform: translateY(0.08em); }
  100% { opacity: 1; filter: blur(0); transform: none; }
}
@keyframes prism-pass {
  0% {
    filter: blur(0);
    text-shadow: 0 0 0 rgba(255, 30, 100, 0), 0 0 0 rgba(0, 170, 255, 0), 0 0 0 rgba(255, 200, 0, 0);
  }
  45% {
    filter: blur(1.2px);
    text-shadow: -0.12em 0 0.04em rgba(255, 30, 100, 0.9), 0.12em 0 0.04em rgba(0, 170, 255, 0.9), 0 0.08em 0.05em rgba(255, 200, 0, 0.8);
  }
  100% {
    filter: blur(0);
    text-shadow: 0 0 0 rgba(255, 30, 100, 0), 0 0 0 rgba(0, 170, 255, 0), 0 0 0 rgba(255, 200, 0, 0);
  }
}

/* homepage */
.site-header.is-open .intro-text .w {
  opacity: 1;
  filter: none;
  transform: none;
  transition: none;
  animation:
    blur-in 1.1s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * 16ms) both,
    prism-pass 0.9s ease-in-out calc(var(--t0, 2s) + var(--x, 0) * 1.3s) none;
}

/* About: the belief line, once it is on screen */
.prism-sweep .w { display: inline-block; opacity: 0; }
.prism-sweep.in-view .w {
  animation:
    blur-in 1.3s cubic-bezier(.2, .7, .2, 1) calc(0.3s + var(--i) * 70ms) both,
    prism-pass 1.1s ease-in-out calc(var(--t0, 2.5s) + var(--x, 0) * 1.5s) none;
}

@media (prefers-reduced-motion: reduce) {
  .site-header.is-open .intro-text .w, .prism-sweep.in-view .w { animation: none; opacity: 1; }
  .prism-sweep .w { opacity: 1; }
}

/* About: "conviction" is simply underlined */
.underline {
  text-decoration: underline;
  text-decoration-thickness: 0.022em;
  text-underline-offset: 0.14em;
}
