:root {
  --bg: #0C0C0E;
  --bg-2: #141417;
  --panel: #17171B;
  --line: #26262C;
  --text: #E7E7EA;
  --text-muted: #8A8A93;
  --text-dim: #5E5E66;
  --accent: #C6C8CE;
  --accent-muted: #9A9CA3;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --content-width: 1200px;
  --gap-section: clamp(80px, 12vh, 160px);
  --pad-inline: clamp(24px, 6vw, 96px);

  /* Typographic scale — §4.1. Use only these levels for content type. */
  --fs-hero-name: clamp(48px, 7vw, 88px);
  --fs-section-title: clamp(32px, 4vw, 48px);
  --fs-card-title: clamp(22px, 2.4vw, 28px);
  --fs-body: clamp(16px, 1.2vw, 18px);
  --fs-eyebrow: 13px;

  --line-hairline: rgba(255, 255, 255, 0.08);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}

.section-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--pad-inline);
}

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 20px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px var(--pad-inline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-mono {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
}

.nav-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s ease;
}

.nav-link:hover { color: var(--accent); }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.burger span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(12, 12, 14, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.mobile-nav-links .nav-link {
  font-family: var(--serif);
  font-size: clamp(22px, 5vw, 30px);
  color: var(--text);
}

.mobile-nav-links .nav-link:hover { color: var(--accent); }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .burger { display: flex; }
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(140px, 22vw, 200px) 0 var(--gap-section);
}

.hero-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--pad-inline);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(48px, 6vw, 96px);
  align-items: center;
}

.hero-name {
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--fs-hero-name);
  line-height: 1.1;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
}

.hero-flip {
  position: relative;
  height: 1.8em;
  margin: 0 0 28px;
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 25px);
  font-weight: 300;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .hero-flip { height: 3.2em; }
}

.flip-phrase {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  opacity: 0;
  transition: opacity 1s ease;
}

.flip-phrase.is-active { opacity: 1; }

.flip-word {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

/* ---------- Sketch / pencil-drawn accents (underline, circle) ---------- */

.sketch-svg { position: absolute; overflow: visible; pointer-events: none; }

.sketch-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  transition: stroke-dashoffset 480ms cubic-bezier(0.65, 0, 0.35, 1);
}

.sketch-path-2 {
  stroke-width: 1.5;
  opacity: 0.5;
  transition-delay: 40ms;
}

.hero-essence {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  max-width: 42ch;
  margin: 0 0 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 2px;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
  display: inline-block;
}

.btn-filled {
  background: var(--accent);
  color: var(--bg);
}

.btn-filled:hover { background: var(--accent-muted); }

.btn-outline {
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-outline:hover { border-color: var(--accent-muted); color: var(--accent); }

.hero-photo { display: flex; justify-content: center; }

.photo-frame {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3 / 4;
  border-radius: 2px;
  background: var(--bg);
  overflow: hidden;
}

.photo-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mask-image: radial-gradient(ellipse 46% 52% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 46% 52% at 50% 40%, #000 30%, transparent 100%);
}

.photo-tag {
  position: absolute;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-muted);
}

.photo-tag-tl { top: 18px; left: 18px; }
.photo-tag-br { bottom: 18px; right: 18px; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { order: -1; margin-bottom: 16px; }
  .photo-frame { max-width: 260px; }
}

/* ---------- reveal (hero load-in) ---------- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--d, 0) * 110ms);
}

.reveal.is-in { opacity: 1; transform: translateY(0); }

/* ---------- fade-up (scroll reveal) — §6.1 ---------- */

.fade-up {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.is-in { opacity: 1; transform: translateY(0); }

/* ---------- About ---------- */

.about { padding: var(--gap-section) 0; border-top: 1px solid var(--line); }

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: clamp(32px, 6vw, 80px);
}

.about-thesis {
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--fs-section-title);
  line-height: 1.1;
  margin: 0;
  color: var(--text);
}

.about-body p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: var(--fs-body);
  line-height: 1.55;
  max-width: 60ch;
}

.about-body p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Services ---------- */

.services { padding: var(--gap-section) 0; border-top: 1px solid var(--line); }

.service {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: clamp(24px, 5vw, 56px);
  padding: 56px 0;
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.service::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.service::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.02);
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.25s ease;
  pointer-events: none;
}

.service:hover::before { opacity: 1; }
.service:hover::after { opacity: 1; background-color: rgba(255, 255, 255, 0.04); }

.service-num {
  position: relative;
  z-index: 1;
  display: inline-block;
  justify-self: start;
  width: fit-content;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1;
  color: rgba(255, 255, 255, 0.3);
}

.sketch-circle {
  left: -0.5em;
  top: -0.32em;
  width: calc(100% + 1em);
  height: 1.64em;
}

.service:hover .sketch-circle .sketch-path { stroke-dashoffset: 0; }

.service-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-card-title);
  line-height: 1.1;
  min-height: 2.2em;
  display: flex;
  align-items: flex-start;
  margin: 0 0 20px;
  color: var(--text);
}

.service-text p { margin: 0; font-size: var(--fs-body); line-height: 1.55; max-width: 68ch; position: relative; }

.service-key { color: var(--text); }
.service-rest { color: var(--text-muted); }

@media (max-width: 640px) {
  .service { grid-template-columns: 1fr; gap: 12px; }
  .service-num { font-size: 32px; }
}

/* ---------- Why (+ stats attached as proof) ---------- */

.why { padding: var(--gap-section) 0; border-top: 1px solid var(--line); }

.why-intro {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 32px;
}

.why-thesis {
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--fs-card-title);
  line-height: 1.35;
  margin: 0 0 32px;
  padding: 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
}

.why-mark {
  position: relative;
  display: inline-block;
  color: var(--accent);
  font-weight: 500;
}

.sketch-underline {
  left: -3%;
  bottom: -0.28em;
  width: 106%;
  height: 0.5em;
}

.why-thesis.is-in .sketch-underline .sketch-path { stroke-dashoffset: 0; transition-delay: 380ms; }

.why-proof {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 32px;
}

/* ---------- Stats — §5 (rendered inside "why" as the numeric proof of why-proof) ---------- */

.stats-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 56px);
}

.why-stats { margin: 0; }

.stat {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.stat-num-wrap {
  position: relative;
  display: inline-block;
}

.stat-num {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1;
  color: var(--accent);
}

.stat-num-wrap .sketch-underline {
  left: -4%;
  bottom: -0.3em;
  width: 108%;
  height: 0.4em;
}

.stats-row.is-in .sketch-underline .sketch-path { stroke-dashoffset: 0; transition-delay: 900ms; }

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
  max-width: 20ch;
}

@media (max-width: 760px) {
  .stat { flex: 1 1 40%; }
}

/* ---------- Work ---------- */

.work { padding: var(--gap-section) 0; border-top: 1px solid var(--line); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 32px;
}

.work-cell {
  position: relative;
  background: var(--panel);
  padding: clamp(28px, 3vw, 40px);
  overflow: hidden;
}

.work-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.02);
  opacity: 0;
  transition: opacity 0.25s ease, background-color 0.25s ease;
  pointer-events: none;
}

.work-cell:hover::after { opacity: 1; background-color: rgba(255, 255, 255, 0.04); }

.work-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: var(--fs-card-title);
  line-height: 1.1;
  min-height: 2.2em;
  display: flex;
  align-items: flex-start;
  margin: 0 0 16px;
  position: relative;
}

.work-cell p {
  margin: 0;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-muted);
  position: relative;
}

.work-limit {
  font-style: italic;
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
}

@media (max-width: 760px) {
  .work-grid { grid-template-columns: 1fr; }
}

/* ---------- Custom blocks (admin-added) ---------- */

.block { padding: var(--gap-section) 0; border-top: 1px solid var(--line); }

.block-thesis {
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--fs-section-title);
  line-height: 1.1;
  max-width: 24ch;
  margin: 0 0 24px;
}

.block-body {
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 68ch;
  margin: 0;
}

/* ---------- Contact ---------- */

.contact { padding: var(--gap-section) 0; border-top: 1px solid var(--line); }

.contact-thesis {
  font-family: var(--serif);
  font-weight: 300;
  font-size: var(--fs-section-title);
  line-height: 1.1;
  max-width: 22ch;
  margin: 0 0 48px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.contact-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  text-decoration: none;
  color: var(--text);
  transition: color 0.25s ease;
}

.contact-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: color 0.25s ease;
}

.contact-link:hover .contact-icon { color: var(--accent); }

.contact-link::after {
  content: "";
  position: absolute;
  left: 32px;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
}

.contact-link:hover { color: var(--accent); }
.contact-link:hover::after { transform: scaleX(1); }

/* ---------- Sticky CTA — §6.4 (replaces the old always-visible nav CTA) ---------- */

.sticky-cta {
  position: fixed;
  right: clamp(16px, 4vw, 32px);
  bottom: clamp(16px, 4vw, 32px);
  z-index: 90;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  background: rgba(12, 12, 14, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 28px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.25s ease, color 0.25s ease;
}

.sticky-cta.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sticky-cta:hover {
  border-color: var(--accent-muted);
  color: var(--accent);
}

@media (max-width: 640px) {
  .sticky-cta { padding: 12px 22px; font-size: 13px; }
}

/* ---------- Footer ---------- */

.footer { border-top: 1px solid var(--line); padding: 32px 0 48px; }

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .fade-up, .flip-phrase, .sticky-cta, .sketch-path {
    transition: none !important;
  }
}
