/* ==========================================================================
   NexStudio — editorial studio site
   1.  Tokens
   2.  Reset & base
   3.  Typographic primitives
   4.  Links & buttons
   5.  Layout: wrap, section, rail
   6.  Header & navigation
   7.  Hero, specimen & clients
   8.  Selected work
   9.  Capabilities
   10. Studio: copy, quote, figures
   11. Contact
   12. Footer
   13. Motion
   14. Responsive
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------ */

:root {
  color-scheme: light;

  /* Warm paper / ink palette. One accent, used sparingly. */
  --paper: #efede8;
  --paper-raised: #f7f6f2;
  --paper-sunken: #e6e3da;
  --ink: #121210;
  --ink-80: #35342d;
  --ink-60: #605d53;
  --ink-40: #8e8a7e;
  --ink-20: #bcb8ac;
  --rule: rgba(18, 18, 16, 0.14);
  --rule-strong: rgba(18, 18, 16, 0.32);
  --accent: #1e34de;
  --accent-deep: #14229c;

  --font-sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", Iowan Old Style, Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale: text sizes settle, display sizes scale with the viewport. */
  --t-mono: 0.6875rem;
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: clamp(1.125rem, 1.04rem + 0.36vw, 1.375rem);
  --t-xl: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --d-sm: clamp(1.75rem, 1.45rem + 1.4vw, 2.625rem);
  --d-md: clamp(2.125rem, 1.55rem + 2.7vw, 3.875rem);
  --d-lg: clamp(2.75rem, 1.3rem + 7vw, 6.75rem);

  --wrap: 82rem;
  --gutter: clamp(1.25rem, 0.8rem + 1.9vw, 2.5rem);
  --rail: clamp(5.5rem, 3.5rem + 6vw, 10.5rem);
  --rail-gap: clamp(1.75rem, 0.9rem + 3.4vw, 4.5rem);
  --section-y: clamp(4.25rem, 2.8rem + 6.4vw, 9rem);
  --header-h: 4.5rem;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Token swap: any block that carries .invert flips to ink ground. Components
   read only from the tokens, so nothing needs a second set of rules. */
.invert {
  --paper: #101010;
  --paper-raised: #191918;
  --paper-sunken: #0a0a0a;
  --ink: #f3f2ed;
  --ink-80: rgba(243, 242, 237, 0.78);
  --ink-60: rgba(243, 242, 237, 0.6);
  --ink-40: rgba(243, 242, 237, 0.42);
  --ink-20: rgba(243, 242, 237, 0.24);
  --rule: rgba(243, 242, 237, 0.16);
  --rule-strong: rgba(243, 242, 237, 0.4);
  --accent: #a9b4ff;
  --accent-deep: #ffffff;

  background-color: var(--paper);
  color: var(--ink);
}

/* Film grain — reads as print texture on the ink grounds only. */
.invert::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

/* 2. Reset & base ------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100%;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-md);
  font-weight: 400;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  list-style: none;
}

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

/* 3. Typographic primitives -------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

/* Mono metadata: section indices, captions, table labels. */
.label {
  display: flex;
  align-items: baseline;
  gap: 0.7em;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.label-num {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.display {
  font-size: var(--d-md);
  letter-spacing: -0.042em;
  line-height: 0.96;
}

.lead {
  font-size: var(--t-lg);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--ink-60);
  max-width: 46ch;
}

.copy {
  max-width: 62ch;
  color: var(--ink-80);
}

.copy + .copy {
  margin-top: 1.1em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.status-dot {
  position: relative;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background-color: var(--accent);
  flex: none;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -0.22rem;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.45;
  animation: pulse 2.6s var(--ease) infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.7);
    opacity: 0;
  }
  50% {
    transform: scale(1);
    opacity: 0.5;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.7rem 1rem;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-250%);
  transition: transform 0.3s var(--ease);
}

.skip-link:focus-visible {
  transform: none;
}

/* 4. Links & buttons --------------------------------------------------- */

/* Text link with a rule that redraws on hover. */
.link {
  position: relative;
  display: inline-block;
  padding-bottom: 0.15em;
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.link::before,
.link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
}

.link::before {
  opacity: 0.28;
}

.link::after {
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}

.link:hover::after,
.link:focus-visible::after {
  transform: scaleX(1);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
  padding: 1.05rem 1.5rem;
  border: 1px solid var(--ink);
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  isolation: isolate;
}

.btn > * {
  position: relative;
  z-index: 1;
}

/* Ground sweeps up on hover — no lift, no drop shadow. */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--accent);
  transform: translateY(101%);
  transition: transform 0.42s var(--ease-out);
}

.btn:hover::after,
.btn:focus-visible::after {
  transform: none;
}

.btn:hover,
.btn:focus-visible {
  color: #fff;
}

.btn-sm {
  padding: 0.7rem 1.05rem;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--accent);
}

.arrow {
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
  transition: transform 0.42s var(--ease-out);
}

.btn:hover .arrow,
.link:hover .arrow {
  transform: translate(0.15rem, -0.15rem);
}

/* 5. Layout ------------------------------------------------------------ */

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

.section {
  position: relative;
  padding-block: var(--section-y);
  border-top: 1px solid var(--rule);
  scroll-margin-top: var(--header-h);
}

/* Sticky mono rail on the left, content on the right. */
.section-grid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: var(--rail-gap);
}

.rail {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  align-self: start;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem clamp(2rem, 6vw, 5rem);
}

.section-title {
  font-size: var(--d-md);
  letter-spacing: -0.042em;
  line-height: 0.96;
  max-width: 26ch;
}

.section-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* 6. Header & navigation ----------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease);
}

.site-header.is-scrolled {
  background-color: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom-color: var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-h);
}

/* Reading-progress hairline, pinned to the header edge. */
.progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.site-header.is-scrolled .progress {
  opacity: 1;
}

/* Wordmark: type plus a square full stop. No logo box. */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.brand-stop {
  width: 0.3rem;
  height: 0.3rem;
  background-color: var(--accent);
  transition: transform 0.5s var(--ease-out);
}

.brand:hover .brand-stop {
  transform: rotate(45deg) scale(1.15);
}

.primary-nav ul {
  display: flex;
  gap: clamp(1.1rem, 0.4rem + 1.7vw, 2.1rem);
}

.primary-nav a {
  position: relative;
  display: inline-block;
  padding-block: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  transition: color 0.3s var(--ease);
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.1rem;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}

.primary-nav a:hover {
  color: var(--ink);
}

.primary-nav a:hover::after,
.primary-nav a[aria-current="true"]::after {
  transform: scaleX(1);
}

.primary-nav a[aria-current="true"] {
  color: var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  transition: border-color 0.3s var(--ease);
}

.menu-toggle:hover {
  border-color: var(--ink);
}

.menu-toggle-bars {
  display: block;
  position: relative;
  width: 1rem;
  height: 0.5rem;
}

.menu-toggle-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--ink);
  transition: transform 0.35s var(--ease);
}

.menu-toggle-bars span:first-child {
  top: 0;
}

.menu-toggle-bars span:last-child {
  bottom: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:first-child {
  transform: translateY(0.25rem) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bars span:last-child {
  transform: translateY(-0.25rem) rotate(-45deg);
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  background-color: var(--paper);
  padding-block: calc(var(--header-h) + 2rem) 2.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}

.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3rem;
  height: 100%;
  overflow-y: auto;
}

.mobile-nav-inner li {
  border-top: 1px solid var(--rule);
}

.mobile-nav-inner li:last-child {
  border-bottom: 1px solid var(--rule);
}

.mobile-nav-inner ul a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.1rem;
  font-size: var(--d-sm);
  font-weight: 500;
  letter-spacing: -0.04em;
  transition: color 0.3s var(--ease);
}

.mobile-nav-inner ul a span {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  color: var(--ink-40);
}

.mobile-nav-inner ul a:hover {
  color: var(--accent);
}

.mobile-nav-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

/* 7. Hero, specimen & clients ------------------------------------------ */

.hero {
  padding-top: clamp(2.5rem, 1.5rem + 4vw, 5rem);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.hero-title {
  margin-top: clamp(2rem, 1.2rem + 3vw, 4rem);
  font-size: var(--d-lg);
  line-height: 0.9;
  letter-spacing: -0.05em;
  max-width: 20ch;
}

/* Each line sits in its own mask so the reveal wipes upward. */
.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hero-title .line > span {
  display: block;
}

.hero-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(1.75rem, 1rem + 3vw, 4rem);
  margin-top: clamp(2rem, 1.2rem + 2.6vw, 3.5rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  justify-self: start;
}

/* Spec table: mono label over value, hairline between cells. */
.spec {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(2.75rem, 2rem + 3vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.spec > div {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.4rem clamp(0.75rem, 1.6vw, 1.5rem) 0;
  border-left: 1px solid var(--rule);
}

.spec > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.spec dd {
  font-size: var(--t-sm);
  line-height: 1.45;
  color: var(--ink);
}

.specimen {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 21 / 8;
  min-height: 13rem;
  margin-top: clamp(3rem, 2rem + 3.5vw, 5.5rem);
  padding: clamp(1.1rem, 0.8rem + 1vw, 1.9rem);
}

.specimen-rules {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 12.5%);
}

.specimen-rules::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 58%;
  height: 1px;
  background-color: var(--accent);
  opacity: 0.55;
}

.specimen-word {
  position: absolute;
  left: -0.035em;
  bottom: -0.16em;
  z-index: 2;
  font-size: clamp(3.5rem, 17.5vw, 15rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
  color: var(--paper-raised);
  user-select: none;
}

.specimen .label {
  position: relative;
  z-index: 4;
}

.specimen-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.clients {
  margin-top: clamp(3rem, 2rem + 3.5vw, 5.5rem);
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 1.5rem;
  border-block: 1px solid var(--rule);
}

.clients-grid li {
  padding: 1.35rem clamp(0.5rem, 1.2vw, 1rem);
  border-left: 1px solid var(--rule);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink-60);
  transition: color 0.3s var(--ease);
}

.clients-grid li:first-child {
  padding-left: 0;
  border-left: 0;
}

.clients-grid li:hover {
  color: var(--ink);
}

/* 8. Selected work ----------------------------------------------------- */

.work-list {
  border-top: 1px solid var(--rule);
  margin-top: clamp(2rem, 1.4rem + 2vw, 3.25rem);
}

.work-list li {
  border-bottom: 1px solid var(--rule);
}

.work-row {
  position: relative;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) minmax(0, 15rem) 4rem 1.25rem;
  align-items: center;
  gap: 1.5rem;
  padding-block: clamp(1.35rem, 1rem + 1.5vw, 2.1rem);
}

/* Accent rule draws across the row on hover. */
.work-row::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}

.work-row:hover::after,
.work-row:focus-visible::after {
  transform: scaleX(1);
}

.work-num {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  color: var(--ink-40);
  transition: color 0.3s var(--ease);
}

.work-row:hover .work-num {
  color: var(--accent);
}

.work-name {
  font-size: var(--t-xl);
  font-weight: 500;
  letter-spacing: -0.038em;
  line-height: 1.1;
  transition: transform 0.5s var(--ease-out);
}

.work-row:hover .work-name {
  transform: translateX(0.4rem);
}

.work-tags,
.work-year {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.work-year {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.work-row .arrow {
  justify-self: end;
  width: 0.85rem;
  height: 0.85rem;
  color: var(--ink-20);
  transition: transform 0.5s var(--ease-out), color 0.3s var(--ease);
}

.work-row:hover .arrow {
  transform: translate(0.2rem, -0.2rem);
  color: var(--accent);
}

/* Cursor-tracked project plate. Outer node is moved by script, inner node
   owns the transitions so the two never fight. */
.work-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: clamp(12rem, 15vw, 16rem);
  pointer-events: none;
  will-change: transform;
}

.work-cursor-inner {
  position: relative;
  aspect-ratio: 4 / 5;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease-out);
}

.work-cursor.is-active .work-cursor-inner {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.plate {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.plate.is-active {
  opacity: 1;
}

.plate svg {
  width: 100%;
  height: 100%;
}

/* 9. Capabilities ------------------------------------------------------ */

.cap-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 1rem + 4vw, 5rem);
  margin-top: clamp(2rem, 1.4rem + 2vw, 3.25rem);
}

.cap {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: 0 1rem;
  padding-block: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  border-top: 1px solid var(--rule);
}

.cap::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 100%;
  height: 1px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease-out);
}

.cap:hover::before {
  transform: scaleX(1);
}

.cap-num {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  line-height: 1.9;
  color: var(--ink-40);
  transition: color 0.3s var(--ease);
}

.cap:hover .cap-num {
  color: var(--accent);
}

.cap-title {
  font-size: var(--t-lg);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.cap-copy {
  grid-column: 2;
  max-width: 40ch;
  margin-top: 0.5rem;
  font-size: var(--t-sm);
  line-height: 1.6;
  color: var(--ink-60);
}

/* 10. Studio ----------------------------------------------------------- */

.studio-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  margin-top: clamp(2rem, 1.4rem + 2vw, 3.25rem);
}

.quote {
  align-self: start;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--d-sm);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.quote footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.quote cite {
  font-style: normal;
  color: var(--ink);
}

.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
  border-top: 1px solid var(--rule);
}

.figure {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.5rem clamp(0.75rem, 1.6vw, 1.5rem) 0;
  border-left: 1px solid var(--rule);
}

.figure:first-child {
  padding-left: 0;
  border-left: 0;
}

.figure dt {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.figure dd {
  font-size: var(--d-sm);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.figure dd sup {
  margin-left: 0.08em;
  font-size: 0.34em;
  font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: super;
  color: var(--accent);
}

/* 11. Contact ---------------------------------------------------------- */

.contact {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4.5rem, 3rem + 7vw, 10rem);
  border-top: 0;
}

.contact > .wrap {
  position: relative;
  z-index: 4;
}

.contact-title {
  margin-top: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  font-size: var(--d-md);
  letter-spacing: -0.045em;
  line-height: 0.96;
  max-width: 22ch;
}

.contact-title em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.mail-link {
  display: inline-block;
  margin-top: clamp(2rem, 1.4rem + 2vw, 3rem);
  padding-bottom: 0.3rem;
  font-size: var(--t-xl);
  font-weight: 500;
  letter-spacing: -0.035em;
  border-bottom: 1px solid var(--rule-strong);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.mail-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.contact-note {
  max-width: 44ch;
  margin-top: 1.5rem;
  font-size: var(--t-sm);
  line-height: 1.65;
  color: var(--ink-60);
}

.contact .spec {
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 12. Footer ----------------------------------------------------------- */

.site-footer {
  padding-block: clamp(3rem, 2rem + 3vw, 4.5rem) 1.75rem;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
  gap: clamp(2.5rem, 1.5rem + 4vw, 5rem);
}

.footer-brand p {
  max-width: 30ch;
  margin-top: 1rem;
  font-size: var(--t-sm);
  line-height: 1.6;
  color: var(--ink-60);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.footer-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.footer-nav a,
.footer-bottom a {
  font-size: var(--t-sm);
  color: var(--ink-80);
  transition: color 0.3s var(--ease);
}

.footer-nav a:hover,
.footer-bottom a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-top: clamp(3rem, 2rem + 3vw, 4.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.footer-bottom .label {
  color: var(--ink-40);
}

.footer-bottom ul {
  display: flex;
  gap: 1.5rem;
}

/* 13. Motion ----------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(0.9rem);
  transition: opacity 0.9s var(--ease-out) var(--delay, 0ms),
    transform 0.9s var(--ease-out) var(--delay, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* The line-masked hero title animates its lines, not itself. */
.js [data-reveal="lines"] {
  opacity: 1;
  transform: none;
}

.js [data-reveal="lines"] .line > span {
  transform: translateY(110%);
  transition: transform 1.1s var(--ease-out);
}

.js [data-reveal="lines"].is-visible .line > span {
  transform: none;
}

.js [data-reveal="lines"] .line:nth-child(2) > span {
  transition-delay: 0.09s;
}

.js [data-reveal="lines"] .line:nth-child(3) > span {
  transition-delay: 0.18s;
}

/* 14. Responsive ------------------------------------------------------- */

@media (max-width: 68rem) {
  .work-row {
    grid-template-columns: 2.5rem minmax(0, 1fr) minmax(0, 11rem) 3.5rem 1.25rem;
    gap: 1rem;
  }
}

@media (max-width: 62rem) {
  .section-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
  }

  .rail {
    position: static;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--rule);
  }

  .cap-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-body,
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
  }

  .quote {
    max-width: 34ch;
  }
}

@media (max-width: 54rem) {
  .primary-nav,
  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero-title {
    max-width: none;
  }

  .hero-body {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .spec,
  .contact .spec {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .clients-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .clients-grid li:nth-child(4) {
    padding-left: 0;
    border-left: 0;
  }

  .clients-grid li:nth-child(-n + 3) {
    border-bottom: 1px solid var(--rule);
  }

  .work-row {
    grid-template-columns: 2.25rem minmax(0, 1fr) 1.25rem;
    grid-template-areas:
      "num name arrow"
      ".   meta meta";
    gap: 0.5rem 1rem;
  }

  .work-num {
    grid-area: num;
  }

  .work-name {
    grid-area: name;
  }

  .work-row .arrow {
    grid-area: arrow;
  }

  .work-tags {
    grid-area: meta;
  }

  .work-year {
    display: none;
  }

  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 1.25rem;
  }

  .figure:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .footer-nav {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  }
}

@media (max-width: 34rem) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-actions .btn {
    justify-content: space-between;
  }

  .specimen {
    aspect-ratio: 4 / 3;
  }

  .spec,
  .contact .spec {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  .spec > div {
    padding-left: 0;
    padding-bottom: 1.4rem;
    border-left: 0;
    border-bottom: 1px solid var(--rule);
  }

  .spec > div:last-child {
    border-bottom: 0;
  }

  .clients-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-grid li:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .clients-grid li:nth-child(-n + 4) {
    border-bottom: 1px solid var(--rule);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .js [data-reveal="lines"] .line > span {
    transform: none;
  }
}
