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

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --rule: #e0e0e0;
  --muted: #888888;
  --pad: clamp(24px, 5vw, 80px);
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

html {
  scroll-behavior: smooth;
  background: #ffffff;
}

body {
  background: #ffffff;
  color: var(--black);
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  letter-spacing: normal;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
  border: none;
  outline: none;
}

button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  outline: none;
}

/* CUSTOM CURSOR */
.cur, .cur-ring { display: none; }
@media (hover: hover) and (pointer: fine) {
  body:not(.is-locked) { cursor: none; }
  .cur, .cur-ring { display: block; }
}
.cur { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; mix-blend-mode: difference; }
.cur-dot { width: 6px; height: 6px; background: #fff; border-radius: 50%; transform: translate(-50%, -50%); }
.cur-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9998; width: 28px; height: 28px; border: 1px solid var(--black); border-radius: 50%; transform: translate(-50%, -50%); transition: transform 0.35s var(--ease), width 0.3s, height 0.3s; opacity: 0.4; }
.cur-ring.big { width: 52px; height: 52px; opacity: 0.2; }

main {
  background: #ffffff;
}

/* LINKS */
.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 13px;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.3s ease;
}

.link-cta::before {
  content: '[';
  margin-right: 0.35em;
  opacity: 0.45;
}

.link-cta::after {
  content: ']';
  margin-left: 0.35em;
  opacity: 0.45;
}

.link-cta .arr, .contact-email .arr, .footer-links a .arr {
  display: inline-flex;
  transition: transform 0.3s var(--ease);
}

.link-cta:hover .arr, .contact-email:hover .arr, .footer-links a:hover .arr {
  transform: rotate(-45deg);
}

/* HERO (Movie-like Entrance) */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 var(--pad);
}

body.home .hero {
  height: 100svh;
  min-height: 100svh;
}

body.home .hero-title-wrap {
  max-width: var(--hero-copy-width);
  transition: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  /* 36em ≈ 504px — too narrow on desktop; widens by breakpoint */
  --hero-copy-width: min(100%, 36em);
}

@media (min-width: 600px) {
  .hero-content {
    --hero-copy-width: min(100%, 40em);
  }
}

@media (min-width: 900px) {
  .hero-content {
    --hero-copy-width: min(680px, 88vw);
  }
}

@media (min-width: 1200px) {
  .hero-content {
    --hero-copy-width: min(760px, 72vw);
  }
}

.hero-title-wrap {
  width: 100%;
  min-height: clamp(80px, 15vw, 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: max-width 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.hero-title-wrap.is-settled {
  max-width: var(--hero-copy-width);
}

.hero-title {
  width: 100%;
  display: flex;
  justify-content: center;
  font-size: clamp(3.5rem, 12vw, 9.5rem);
  line-height: 0.95;
  transform-origin: center center;
  transition:
    font-size 1.2s cubic-bezier(0.77, 0, 0.175, 1),
    transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Line is only as wide as the typed text; caret sits after it, out of flow */
.typewriter-line {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1023px) {
  .hero-title {
    font-size: clamp(4rem, 10vw, 6.5rem);
  }

  .hero-title.is-shrunk {
    font-size: clamp(3.25rem, 7.5vw, 5.25rem);
    transform: translateY(-32px);
  }
}

/* Desktop — one line, large type, lift only (no shrink) */
@media (min-width: 1024px) {
  .hero-title-wrap,
  .hero-title-wrap.is-settled {
    max-width: var(--hero-copy-width);
  }

  .hero-title {
    font-size: 8rem;
    white-space: nowrap;
  }

  .hero-title.is-shrunk {
    font-size: 8rem;
    transform: translateY(-44px);
  }
}

@media (min-width: 1400px) {
  .hero-title,
  .hero-title.is-shrunk {
    font-size: 8.75rem;
  }
}

@media (min-width: 1800px) {
  .hero-title,
  .hero-title.is-shrunk {
    font-size: 9.25rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(3.25rem, 16.5vw, 5.5rem);
  }

  .hero-title.is-shrunk {
    font-size: clamp(3.15rem, 14.5vw, 5rem);
    transform: translateY(-16px);
  }
}

.typewriter-text {
  display: inline-block;
}

.typewriter-caret {
  position: absolute;
  left: 100%;
  top: 50%;
  width: 4px;
  height: 0.8em;
  margin-left: 8px;
  background: var(--black);
  transform: translateY(-50%);
  animation: typewriter-blink 1s step-end infinite;
}

.typewriter-caret.is-hidden {
  animation: none;
  opacity: 0;
  visibility: hidden;
}

@keyframes typewriter-blink {
  50% { opacity: 0; }
}

.hero-lead-wrap {
  margin-top: 0;
  width: var(--hero-copy-width);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-lead {
  width: 100%;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--muted);
  line-height: 1.55;
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(6px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), filter 0.8s var(--ease);
}

@media (min-width: 900px) {
  #hero-lead {
    white-space: nowrap;
  }
}

.hero-lead.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 40px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.hero-actions.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ORIGIN SEQUENCE (Scroll Storytelling) */
.origin-sequence {
  height: 400vh; /* Creates scroll distance */
  position: relative;
  background: #ffffff; /* White background for the frame */
}

.origin-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffffff;
}

.origin-frame-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform, width, height;
}

.origin-frame-inner.is-square {
  inset: auto;
  left: 50%;
  top: 50%;
  width: var(--square-size, min(48vw, 52vh));
  height: var(--square-size, min(48vw, 52vh));
  transform: translate(-50%, -50%);
}

.origin-images {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.origin-images img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.origin-images img:first-child {
  opacity: 1;
}

.origin-corners {
  position: absolute;
  inset: -28px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.origin-corners.is-visible {
  opacity: 1;
}

.origin-corner {
  position: absolute;
  width: clamp(22px, 3.5vw, 40px);
  height: clamp(22px, 3.5vw, 40px);
}

.origin-corner--tl {
  top: 0;
  left: 0;
  border-top: 5px solid var(--black);
  border-left: 5px solid var(--black);
}

.origin-corner--tr {
  top: 0;
  right: 0;
  border-top: 5px solid var(--black);
  border-right: 5px solid var(--black);
}

.origin-corner--bl {
  bottom: 0;
  left: 0;
  border-bottom: 5px solid var(--black);
  border-left: 5px solid var(--black);
}

.origin-corner--br {
  bottom: 0;
  right: 0;
  border-bottom: 5px solid var(--black);
  border-right: 5px solid var(--black);
}

/* WORK SECTION */
.work {
  padding: 160px 0;
  background: #ffffff;
}

.work-header {
  padding: 0 var(--pad);
  margin-bottom: 80px;
}

.section-title {
  font-size: clamp(40px, 6vw, 80px);
  margin-bottom: 12px;
}

.work-prompt {
  font-size: 13px;
  color: var(--muted);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
}

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

.work-card {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  text-align: left;
}

@media (max-width: 900px) {
  .work-card {
    aspect-ratio: 4 / 5;
  }
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s var(--ease);
}

.work-card:hover img {
  transform: scale(1.04);
}

.work-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 32px 32px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  color: var(--white);
  transition: transform 0.4s var(--ease);
}

.work-info h3 {
  font-size: clamp(24px, 3vw, 36px);
  margin-bottom: 8px;
  color: var(--white);
}

.work-info p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Geist', sans-serif;
}

/* WORK PANEL (Drawer) */
.work-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}

.work-panel.is-open,
.work-panel.is-closing {
  visibility: visible;
}

.work-panel.is-open {
  pointer-events: auto;
}

.work-panel.is-closing {
  pointer-events: none;
}

.work-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.work-panel.is-open .work-panel-backdrop {
  opacity: 1;
}

.work-panel-sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 480px);
  background: #ffffff;
  border-left: 1px solid var(--rule);
  padding: clamp(80px, 12vw, 100px) clamp(24px, 5vw, 40px) 40px;
  transform: translateX(100%);
  transition: transform 0.5s var(--ease);
  overflow-y: auto;
}

.work-panel.is-open .work-panel-sheet {
  transform: translateX(0);
}

.work-panel-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  background: #ffffff;
  font-size: 18px;
  line-height: 1;
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.work-panel-close:hover {
  background: var(--black);
  color: var(--white);
}

.work-panel-tag {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.work-panel-name {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(32px, 5vw, 44px);
  margin-bottom: 8px;
}

.work-panel-outcome {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.work-panel-body {
  color: var(--black);
  line-height: 1.75;
  margin-bottom: 40px;
  font-size: 15px;
}

.work-panel-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}

.work-panel-next {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  width: 100%;
  text-align: left;
  font-size: 13px;
  color: var(--black);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: color 0.2s;
}

.work-panel-next:hover {
  color: var(--muted);
}

.work-panel-next .arr {
  display: inline-flex;
  transition: transform 0.3s var(--ease);
}

.work-panel-next:hover .arr {
  transform: translateX(4px);
}

.work-panel-links a {
  font-size: 13px;
  color: var(--black);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: color 0.2s;
  text-decoration: none;
  border-bottom: none;
}

.work-panel-links a:hover {
  color: var(--muted);
}

/* BOARDROOM INTERLUDE */
.boardroom {
  width: 100%;
  padding: 0 var(--pad);
  margin: 0 0 160px;
}

.boardroom img {
  width: 100%;
  height: auto;
  display: block;
}

/* TACTICAL STATS */
.tactical {
  padding: 0 var(--pad) 160px;
  background: #ffffff;
}

.tactical-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .tactical-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.tactical-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--rule);
  padding: clamp(28px, 4vw, 40px);
  min-height: 100%;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.tactical.in .tactical-item {
  opacity: 1;
  transform: translateY(0);
}

.tactical.in .tactical-item:nth-child(1) { transition-delay: 0ms; }
.tactical.in .tactical-item:nth-child(2) { transition-delay: 120ms; }
.tactical.in .tactical-item:nth-child(3) { transition-delay: 240ms; }

.tactical-num {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(64px, 8vw, 100px);
  line-height: 1;
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.tactical-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 18em;
}

/* METHOD SECTION */
.method {
  padding: 0 var(--pad) 160px;
  max-width: 1400px;
  margin: 0 auto;
}

.method .section-title {
  margin-bottom: clamp(48px, 8vw, 96px);
}

.method-list {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.method-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .method-item {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.method-item h3 {
  font-size: clamp(28px, 4vw, 48px);
}

.method-item p {
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--muted);
  max-width: 30em;
}

/* CONTACT */
.contact {
  padding: 160px var(--pad);
  text-align: center;
  background: #ffffff;
  border-top: 1px solid var(--rule);
}

.contact h2 {
  font-size: clamp(48px, 8vw, 120px);
  margin-bottom: 40px;
}

.contact a {
  font-size: clamp(20px, 3vw, 32px);
  color: var(--muted);
  transition: color 0.3s ease;
  border-bottom: none;
}

.contact a:hover {
  color: var(--black);
}

/* FOOTER & SIGNATURE */
.footer-wrap {
  background: #ffffff;
  border-top: 1px solid var(--rule);
}

.footer-signature {
  padding: 80px var(--pad);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: center;
}

.canvas-container {
  width: 100%;
  max-width: 800px;
  padding: 40px;
}

#signature-svg {
  width: 100%;
  height: auto;
  display: block;
}

.sig-path {
  stroke-dasharray: 3200;
  stroke-dashoffset: 3200;
}

.sig-dot {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.canvas-container.sig-visible .sig-path {
  animation: sigDrawPath 4s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.canvas-container.sig-visible .sig-dot-1 {
  animation: sigDrawPath 0.3s ease-out 2.8s forwards;
}

.canvas-container.sig-visible .sig-dot-2 {
  animation: sigDrawPath 0.3s ease-out 3.5s forwards;
}

@keyframes sigDrawPath {
  to { stroke-dashoffset: 0; }
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px var(--pad);
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--black);
}

@media (max-width: 768px) {
  .footer-bar {
    flex-direction: column;
    gap: 24px;
    align-items: center;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px 28px;
  }
}

/* REVEAL ANIMATIONS */
.reveal {
  opacity: 0;
  filter: blur(14px);
  transition: opacity 0.85s var(--ease), filter 0.85s var(--ease);
}

.reveal.in {
  opacity: 1;
  filter: blur(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    filter: none;
    transition: none;
  }
}
