/* ============================================================
   SANC AG · Engineered, not improvised.
   Charcoal #14181C · Paper #F5F5F2 · Signal #2E8BFF · Steel ramp
   ============================================================ */

:root {
  --bg: #14181C;
  --bg-raise: #191E23;
  --ink: #F5F5F2;
  --muted: #A9B3BD;        /* secondary text, ~8:1 on bg */
  --steel: #8C97A3;        /* mono labels, ~5.6:1 on bg */
  --signal: #2E8BFF;
  --line: rgba(245, 245, 242, 0.10);
  --line-strong: rgba(245, 245, 242, 0.18);

  --font-sans: "Helvetica Neue", "Neue Haas Grotesk Text", Helvetica, Arial, sans-serif;
  --font-mono: Menlo, "SF Mono", Consolas, "Liberation Mono", monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-gap: clamp(6rem, 14vh, 11rem);

  /* z-scale */
  --z-nav: 100;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

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

/* The brand dot: the period from the SANC. wordmark */
.dot {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  margin-left: 0.1em;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: 0.02em;
}

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

a { color: inherit; }

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: calc(var(--z-nav) + 1);
  padding: 0.6rem 1rem;
  background: var(--signal);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.skip-link:focus { top: 1rem; }

/* ============ Buttons & links ============ */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.78rem 1.5rem;
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--signal);
  color: var(--bg);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #4D9BFF; }
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 200ms ease, color 200ms ease;
}
.link-arrow::after {
  content: "→";
  font-weight: 400;
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .link-arrow:hover { color: var(--signal); border-color: var(--signal); }
  .link-arrow:hover::after { transform: translateX(4px); }
}

/* ============ Nav ============ */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  background: rgba(20, 24, 28, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: transform 350ms var(--ease-out);
}
.nav.nav-hidden { transform: translateY(-100%); }
.nav:focus-within { transform: none; }

.nav-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo img { height: 26px; width: auto; }

.nav-links {
  display: flex;
  gap: 2.25rem;
  margin-left: auto;
}
.nav-links a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--ink); }
}

/* ============ Hero ============ */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: 68px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 16% 0%, #1B2127 0%, var(--bg) 58%);
}

.hero .container { width: 100%; }

.hero-mark {
  position: absolute;
  right: -8vmin;
  top: 50%;
  width: 74vmin;
  transform: translateY(-50%) rotate(-6deg);
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
}

.hero-title {
  margin: 0 0 1.75rem;
  font-size: clamp(2.75rem, 7.5vw, 5.75rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.line-mask { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.line { display: inline-block; }

.hero-sub {
  margin: 0 0 2.5rem;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
}

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

/* Hero entrance (JS-independent: pure CSS, runs once) */
@media (prefers-reduced-motion: no-preference) {
  .js .line {
    transform: translateY(112%);
    animation: rise 850ms var(--ease-out) forwards;
  }
  .js .line-mask:nth-child(2) .line { animation-delay: 90ms; }
  .js .hero-sub,
  .js .hero-actions {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-up 700ms var(--ease-out) forwards;
  }
  .js .hero-sub { animation-delay: 320ms; }
  .js .hero-actions { animation-delay: 430ms; }
  .js .hero-mark {
    animation: drift 14s var(--ease-in-out) infinite alternate;
  }
}

@keyframes rise { to { transform: translateY(0); } }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }
@keyframes drift {
  from { transform: translateY(-52%) rotate(-6deg); }
  to   { transform: translateY(-46%) rotate(-3deg); }
}

/* ============ Sections shared ============ */

section { scroll-margin-top: 4rem; }

.work, .capabilities, .studio { padding-block: calc(var(--section-gap) / 2); }

/* Section surfaces: raised panels alternate with the base charcoal */
.work, .studio {
  background: #171C22;
  border-block: 1px solid var(--line);
}

.section-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

.section-lede {
  margin: 0 0 3.5rem;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.125rem;
}

/* Scroll reveal fallback (no GSAP): visible by default; IO adds the motion.
   When GSAP loads it owns all reveal choreography instead. */
@media (prefers-reduced-motion: no-preference) {
  .js.no-gsap .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  }
  .js.no-gsap .reveal.in { opacity: 1; transform: none; }
  .js.gsap .hero-mark { animation: none; }
}

/* Word-mask spans created by main.js for title choreography */
.wm {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
}
.w { display: inline-block; }

@media print {
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============ Work ============ */

.shot {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-raise);
}
.shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
  transition: transform 600ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .shot:hover img { transform: scale(1.025); }
}

.work-feature {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(3.5rem, 7vw, 5.5rem);
}

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}

.work-meta h3 {
  margin: 1.5rem 0 0.6rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.work-feature .work-meta h3 { margin-top: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); }
.work-meta p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  max-width: 32rem;
}
.work-meta .link-arrow { font-family: var(--font-mono); font-size: 0.875rem; font-weight: 400; }

/* ============ Capabilities ============ */

.cap-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.cap-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(2.25rem, 4vw, 3.25rem);
  transition: background-color 250ms ease;
}

/* The hairline is a real element so GSAP can draw it on scroll */
.cap-row .rule {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--line-strong);
  transform-origin: left center;
}

.cap-row h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  transition: color 250ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .cap-row:hover h3 { color: var(--signal); }
}

.cap-body p { margin: 0; color: var(--muted); max-width: 38rem; }
.cap-tags {
  margin-top: 1.1rem !important;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--steel);
  letter-spacing: 0.01em;
}

/* ============ Studio ============ */

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.studio-text p {
  margin: 0 0 1.4rem;
  color: var(--muted);
  max-width: 36rem;
  font-size: 1.125rem;
}
.studio-text .section-title { margin-bottom: 1.75rem; }

.portrait { margin: 0 0 2.25rem; }
.portrait img {
  width: 172px;
  height: 172px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  filter: grayscale(25%) contrast(1.02);
}
.portrait figcaption {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--steel);
}

.studio-facts {
  margin: 0.5rem 0 0;
  border-top: 1px solid var(--line);
}
.studio-facts > div {
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.studio-facts dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 0.3rem;
}
.studio-facts dd {
  margin: 0;
  font-size: 0.9875rem;
  color: var(--ink);
}

/* ============ Kinetic band: the real wordmark, repeated ============ */

.band {
  overflow: hidden;
  padding-block: clamp(4rem, 10vh, 7rem) clamp(5rem, 12vh, 8rem);
  user-select: none;
}

.band-track {
  display: flex;
  align-items: center;
  gap: clamp(2.5rem, 7vw, 5rem);
  width: max-content;
  opacity: 0.13;
  will-change: transform;
}

.band-track img {
  height: clamp(3.25rem, 9vw, 6.5rem);
  width: auto;
  flex: none;
}

/* ============ Contact ============ */

/* The paper block: the page's single deliberate theme switch, Swiss-poster style */
.paper {
  background: #F5F5F2;
  color: var(--bg);
}
.paper ::selection { background: var(--bg); color: #F5F5F2; }

.contact {
  padding-block: calc(var(--section-gap) * 0.8);
}

.contact-title {
  margin: 0 0 1.25rem;
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
  max-width: 18ch;
  text-wrap: balance;
}

.contact-sub {
  margin: 0 0 3rem;
  color: #4A545E;
  font-size: 1.125rem;
  max-width: 36rem;
}

.contact-mail {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--bg);
  border-bottom: 2px solid rgba(20, 24, 28, 0.3);
  padding-bottom: 0.15em;
  transition: color 250ms ease, border-color 250ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .contact-mail:hover { color: #1668DB; border-color: #1668DB; }
}
.contact-mail:active { transform: scale(0.99); }

/* ============ Footer ============ */

.footer {
  border-top: 1px solid rgba(20, 24, 28, 0.12);
  padding-block: 2.5rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.footer-brand img { height: 22px; width: auto; }
.footer-brand p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #4A545E;
}

.footer-links { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.footer-links a {
  font-size: 0.875rem;
  color: #3A434C;
  text-decoration: none;
  transition: color 180ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover { color: var(--bg); }
}

/* ============ Responsive ============ */

@media (max-width: 880px) {
  .work-feature,
  .work-grid,
  .studio-grid,
  .cap-row {
    grid-template-columns: 1fr;
  }
  .work-feature { gap: 0; align-items: start; }
  .work-grid { gap: 3.5rem; }
  .work-feature .work-meta h3 { margin-top: 1.5rem; }
  .cap-row { gap: 0.9rem; }
  .hero-mark { right: -30vmin; opacity: 0.035; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .hero { min-height: 88dvh; }
  .hero-actions { gap: 1.5rem; }
  .contact-mail { font-size: clamp(1.25rem, 6.5vw, 1.75rem); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
