/* ---------- Design tokens ---------- */
:root {
  --ink: #1A1A1A;
  --off-white: #F5F3EF;
  --white: #FFFFFF;
  --gray-on-light: #6B6B63;
  --gray-on-dark: #C7C2B4;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --wrap-narrow: 720px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--off-white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

a { color: inherit; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

.wrap--narrow {
  max-width: var(--wrap-narrow);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 560;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 3px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  cursor: pointer;
}

.btn-primary {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
}
.btn-primary:hover { background: transparent; color: var(--white); }

.section--ink .btn-primary,
.hero .btn-primary {
  background: var(--white);
  color: var(--ink);
}
.section--ink .btn-primary:hover,
.hero .btn-primary:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-block { width: 100%; }

/* On light backgrounds, primary button is ink */
.section:not(.section--ink) .btn-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.section:not(.section--ink) .btn-primary:hover {
  background: transparent;
  color: var(--ink);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 24px 0;
  background: rgba(26, 26, 26, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(245, 243, 239, 0.08);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.site-header.on-light {
  background: rgba(245, 243, 239, 0.82);
  border-bottom-color: rgba(26, 26, 26, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 560;
  text-decoration: none;
  color: var(--off-white);
  letter-spacing: -0.01em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
  text-decoration: none;
  color: var(--off-white);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s var(--ease);
}
.main-nav a:hover { opacity: 1; }

.nav-cta {
  border: 1px solid var(--off-white);
  padding: 9px 18px;
  border-radius: 3px;
  opacity: 1 !important;
}
.nav-cta:hover {
  background: var(--off-white);
  color: var(--ink);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--off-white);
  width: 100%;
}

/* Header turns ink-on-light once past the hero */
.site-header.on-light .logo,
.site-header.on-light .main-nav a {
  color: var(--ink);
}
.site-header.on-light .nav-cta {
  border-color: var(--ink);
}
.site-header.on-light .nav-cta:hover {
  background: var(--ink);
  color: var(--off-white);
}
.site-header.on-light .nav-toggle span {
  background: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  background: var(--ink);
  color: var(--off-white);
  display: flex;
  align-items: center;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding-top: 90px;
  padding-bottom: 90px;
  pointer-events: none;
}
.hero-inner a { pointer-events: auto; }

.eyebrow {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-on-dark);
  margin-bottom: 28px;
}

.hero-headline {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  line-height: 1.08;
  max-width: 16ch;
  color: var(--off-white);
  margin-bottom: 32px;
}

.hero-sub {
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 46ch;
  color: var(--gray-on-dark);
  margin-bottom: 44px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.proof-link {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--gray-on-dark);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.proof-link:hover {
  color: var(--off-white);
  border-color: var(--off-white);
}

/* ---------- Sections ---------- */
.section {
  padding: 140px 0;
}

.section--ink {
  background: var(--ink);
  color: var(--off-white);
}

.section--muted {
  background: var(--white);
}

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-on-light);
  margin-bottom: 18px;
}
.section--ink .section-label { color: var(--gray-on-dark); }

.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 24px;
  max-width: 18ch;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--gray-on-light);
  max-width: 56ch;
  margin-bottom: 64px;
}
.section--ink .section-intro { color: var(--gray-on-dark); }

/* ---------- Work ---------- */
.work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.work-card {
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.work-card--live {
  grid-column: span 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
}

.work-card-visual {
  background: var(--off-white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.work-card-visual--soon { opacity: 0.55; }

.browser-motif { width: 100%; height: auto; }
.motif-frame { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.motif-frame--faint { stroke: var(--gray-on-light); stroke-dasharray: 3 4; }
.motif-dot { fill: var(--ink); }
.motif-dot--faint { fill: var(--gray-on-light); }
.motif-block { fill: var(--ink); }
.motif-block-light { fill: var(--gray-on-light); opacity: 0.5; }

.work-card-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}

.work-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.work-card-heading h3 {
  font-size: 1.4rem;
}

.work-tag {
  font-size: 0.8rem;
  color: var(--gray-on-light);
  white-space: nowrap;
}

.work-status {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--gray-on-light);
}

.work-note {
  color: var(--gray-on-light);
  font-size: 0.98rem;
  max-width: 46ch;
}

.work-link {
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  width: fit-content;
}

.work-card--soon {
  grid-column: span 1;
}

@media (max-width: 767px) {
  .work-card-body {
    padding: 28px 24px;
  }
  .work-card-visual {
    padding: 28px;
  }
  .work-card-heading {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .work-card-heading h3 {
    font-size: 1.25rem;
  }
  .work-status {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
  }
}

@media (min-width: 768px) {
  .work-card--soon { grid-column: span 1; }
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .work-card--live { grid-column: span 2; }
}

@media (min-width: 900px) {
  .work-grid { grid-template-columns: repeat(3, 1fr); }
  .work-card--live { grid-column: span 3; }
  .work-card--soon { grid-column: span 1; }
}

/* ---------- Approach ---------- */
.process-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(199, 194, 180, 0.3);
}

.process-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  padding: 44px 0;
  border-bottom: 1px solid rgba(199, 194, 180, 0.3);
}

.process-index {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--gray-on-dark);
}

.process-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.process-body h3 {
  font-size: 1.3rem;
  color: var(--off-white);
}

.process-meta {
  font-size: 0.82rem;
  color: var(--gray-on-dark);
  white-space: nowrap;
}

.process-body p {
  color: var(--gray-on-dark);
  max-width: 56ch;
  font-size: 1rem;
}

/* ---------- Apply ---------- */
.apply-form {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.form-row--split > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
}

.optional {
  color: var(--gray-on-light);
  font-weight: 400;
}

input, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 13px 16px;
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s var(--ease);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.form-note {
  font-size: 0.85rem;
  color: var(--gray-on-light);
  text-align: center;
}

.apply-success {
  margin-top: 40px;
  padding: 32px;
  background: var(--white);
  border-radius: 4px;
  text-align: center;
}
.apply-success h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.apply-success p {
  color: var(--gray-on-light);
}

.apply-error {
  margin-top: 24px;
  padding: 18px 24px;
  border: 1px solid rgba(26, 26, 26, 0.2);
  border-radius: 4px;
  text-align: center;
}
.apply-error p {
  color: var(--ink);
  font-size: 0.95rem;
}

/* ---------- Studio ---------- */
.studio-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.studio-copy p {
  font-size: 1.1rem;
  color: var(--ink);
  max-width: 60ch;
}
.studio-copy p:last-child {
  color: var(--gray-on-light);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--off-white);
  padding: 48px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.logo--footer { color: var(--off-white); }
.footer-cta {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--gray-on-dark);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.footer-cta:hover {
  color: var(--off-white);
  border-color: var(--off-white);
}

/* ---------- Scroll fade-ins ---------- */
.fade-up, .fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.fade-up.is-visible, .fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in.is-visible ~ .fade-in,
.work-card.fade-in { transform: translateY(10px); }

@media (prefers-reduced-motion: reduce) {
  .fade-up, .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* stagger hero elements slightly via transition-delay set in JS-free CSS */
.hero-headline.fade-up { transition-delay: 0.05s; }
.hero-sub.fade-up { transition-delay: 0.15s; }
.hero-actions.fade-up { transition-delay: 0.25s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .work-card--live {
    grid-template-columns: 1fr;
  }
  .process-item {
    grid-template-columns: 60px 1fr;
  }
}

@media (max-width: 720px) {
  .section { padding: 96px 0; }
  .wrap { padding: 0 22px; }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--ink);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 0 40px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a { color: var(--off-white) !important; font-size: 1.1rem; }
  .nav-cta { border-color: var(--off-white) !important; }

  .nav-toggle { display: flex; }

  .form-row--split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}
