/* ==========================================================================
   System Infinity — base
   ========================================================================== */

:root {
  --bg: #14150f;
  --bg-alt: #191b13;
  --bg-elev: #1e2117;
  --text: #edebe6;
  --text-muted: rgba(237, 235, 230, 0.66);
  --text-faint: rgba(237, 235, 230, 0.42);
  --accent: #beac6c;
  --accent-strong: #d3c384;
  --accent-ink: #1a1a12;
  --line: rgba(237, 235, 230, 0.14);
  --line-soft: rgba(237, 235, 230, 0.08);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  --serif: "Crimson Text", Georgia, "Times New Roman", serif;
  --sans: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1180px;
  --header-h: 84px;

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

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

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

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

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
}

p { margin: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 20px;
  z-index: 999;
  font-family: var(--sans);
  font-weight: 600;
}
.skip-link:focus { left: 16px; top: 16px; }

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

section[id] {
  scroll-margin-top: var(--header-h);
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 16px 34px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.4s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(190, 172, 108, 0.28);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

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

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(20, 21, 15, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line-soft);
}

.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark { width: 30px; height: 30px; object-fit: contain; }
.brand-word {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-links a:not(.nav-cta) {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
  padding: 6px 0;
}
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right 0.35s var(--ease);
}
.nav-links a:not(.nav-cta):hover,
.nav-links a:not(.nav-cta).is-active {
  color: var(--text);
}
.nav-links a:not(.nav-cta):hover::after,
.nav-links a:not(.nav-cta).is-active::after {
  right: 0;
}

.nav-cta {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 11px 24px;
  border-radius: 999px;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.nav-cta:hover { background: var(--accent-strong); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 110;
}
.nav-toggle span {
  width: 24px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

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

.hero {
  position: relative;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.06);
  will-change: transform;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 7, 0.55) 0%, rgba(10, 11, 7, 0.32) 30%, rgba(12, 13, 8, 0.5) 68%, rgba(10, 11, 7, 0.86) 100%),
    radial-gradient(120% 80% at 50% 45%, rgba(10, 11, 7, 0.05) 0%, rgba(10, 11, 7, 0.42) 100%);
}
.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: calc(var(--header-h) + 24px) 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 22px;
}

.hero-title {
  font-size: clamp(3rem, 9vw, 7.2rem);
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.35);
  letter-spacing: -0.01em;
}

.hero-subhead {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--text);
  margin-top: 30px;
  max-width: 640px;
}
.hero-subhead--soft {
  color: var(--text-muted);
  margin-top: 10px;
  font-weight: 300;
}

.hero-cta { margin-top: 44px; }

.hero-credit {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-size: 0.75rem;
  color: var(--text-faint);
  font-style: italic;
  font-family: var(--serif);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  right: 32px;
  z-index: 1;
  width: 26px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  display: none;
}
.scroll-cue-line {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 999px;
  background: var(--accent-strong);
  animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(14px); opacity: 0; }
}

@media (min-width: 720px) {
  .scroll-cue { display: block; }
}

/* ==========================================================================
   Section scaffolding
   ========================================================================== */

.section {
  position: relative;
  padding: 128px 0;
  border-top: 1px solid var(--line-soft);
}

.section-head {
  margin-bottom: 56px;
  max-width: 700px;
}
.section-kicker {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.section-title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 600;
  color: var(--text);
}

/* ==========================================================================
   What we do
   ========================================================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.service-card {
  background: var(--bg);
  padding: 44px 38px 48px;
  transition: background-color 0.35s var(--ease);
}
.service-card:hover { background: var(--bg-alt); }

.service-index {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 26px;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: 14px;
  color: var(--text);
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.7;
  font-weight: 300;
}

/* ==========================================================================
   Selected work
   ========================================================================== */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.work-card {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--bg-alt);
  transition: transform 0.5s var(--ease), border-color 0.4s var(--ease), box-shadow 0.5s var(--ease);
}
.work-card:hover, .work-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.work-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.work-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-elev);
}
.work-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.work-card:hover .work-media img { transform: scale(1.08); }

.work-media-tag {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(10, 11, 7, 0.55);
  backdrop-filter: blur(6px);
  padding: 8px 16px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.work-card:hover .work-media-tag,
.work-card:focus-visible .work-media-tag { opacity: 1; transform: translateY(0); }

.work-media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  background: transparent;
}
.work-media--empty span {
  font-family: var(--serif);
  font-size: 2.4rem;
  color: var(--text-faint);
  font-weight: 400;
}

.work-meta { padding: 24px 24px 28px; }
.work-meta h3 { font-size: 1.25rem; margin-bottom: 8px; color: var(--text); }
.work-meta p { color: var(--text-muted); font-size: 0.93rem; font-weight: 300; line-height: 1.6; }

.work-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.work-card--empty { cursor: default; }
.work-card--empty:hover { transform: none; box-shadow: none; }

/* ==========================================================================
   Approach
   ========================================================================== */

.approach {
  background: var(--bg-alt);
  overflow: hidden;
}
.approach-inner { max-width: 820px; }
.approach-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 30px;
}
.approach-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.85;
  max-width: 640px;
}

.approach-mark {
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 340px;
  opacity: 0.05;
  pointer-events: none;
  filter: grayscale(1) brightness(2);
}

/* ==========================================================================
   Start a project — Form
   ========================================================================== */

.start-inner { max-width: 820px; }
.start-sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: -30px;
  margin-bottom: 48px;
  font-weight: 300;
}

.project-form {
  display: flex;
  flex-direction: column;
  gap: 34px;
}
.project-form[hidden] { display: none; }

.field { border: none; padding: 0; margin: 0; min-width: 0; flex: 1; }
.field legend {
  padding: 0;
  margin-bottom: 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.field legend em { color: var(--text-faint); font-style: normal; font-weight: 300; }
.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
}
.field-label em { color: var(--text-faint); font-style: normal; font-weight: 300; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
}

.field-text input,
.field-text textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 300;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.field-text textarea { resize: vertical; min-height: 100px; }
.field-text input::placeholder,
.field-text textarea::placeholder { color: var(--text-faint); }
.field-text input:focus,
.field-text textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 20px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.pill:hover { border-color: var(--text-faint); color: var(--text); }
.pill[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.link-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.link-row[hidden] { display: none; }

.link-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 300;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.link-input::placeholder { color: var(--text-faint); }
.link-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
}

.link-remove {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-faint);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.link-remove:hover { border-color: var(--text-faint); color: var(--text); }
.link-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.add-link-btn {
  margin-top: 14px;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: color 0.25s var(--ease);
}
.add-link-btn:hover { color: var(--accent-strong); }
.add-link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.add-link-btn[hidden] { display: none; }

.form-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.form-note {
  font-size: 0.88rem;
  color: var(--text-faint);
  margin: 0;
}
.form-note.is-error { color: #d99a8a; }

.form-success {
  max-width: 820px;
  margin: 28px auto 0;
  padding: 48px;
  text-align: center;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.form-success h3 {
  font-size: 1.9rem;
  color: var(--text);
  margin-bottom: 14px;
}
.form-success p { color: var(--text-muted); font-weight: 300; line-height: 1.7; }
.form-success a { color: var(--accent); font-weight: 600; }

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

.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 72px 0 40px;
  background: var(--bg-alt);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 32px;
}
.footer-tagline {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
}
.footer-nav {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-nav a {
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: color 0.25s var(--ease);
}
.footer-nav a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-faint);
}
.footer-email { color: var(--text-muted); font-weight: 500; transition: color 0.25s var(--ease); }
.footer-email:hover { color: var(--accent); }
.footer-credit a { color: var(--text-muted); font-weight: 500; }
.footer-credit a:hover { color: var(--accent); }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 6, 0.86);
  backdrop-filter: blur(6px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}
.lightbox-panel img { width: 100%; display: block; }

.lightbox-caption { padding: 26px 30px 30px; }
.lightbox-caption h3 { font-size: 1.4rem; color: var(--text); margin-bottom: 8px; }
.lightbox-caption p { color: var(--text-muted); font-size: 0.95rem; font-weight: 300; }

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(10, 11, 7, 0.6);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.lightbox-close span {
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 1.5px;
  background: var(--text);
  transform-origin: center;
}
.lightbox-close span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.lightbox-close span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

/* ==========================================================================
   Scroll reveal
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-content .reveal { transition-delay: calc(var(--delay, 0) * 1ms); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-img { transform: none; }
  .scroll-cue-line { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

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

@media (max-width: 980px) {
  .services-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    bottom: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 34px;
    background: rgba(15, 16, 11, 0.98);
    backdrop-filter: blur(16px);
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a:not(.nav-cta) { font-size: 1.2rem; }
  .nav-toggle { display: flex; }
  .work-grid { grid-template-columns: 1fr; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .container { padding: 0 22px; }
  .nav-inner { padding: 0 20px; }
  .brand-word { display: none; }
  .section { padding: 92px 0; }
  .hero-credit { font-size: 0.68rem; padding: 0 20px; white-space: normal; text-align: center; }
  .service-card { padding: 36px 26px 40px; }
  .form-footer { flex-direction: column; align-items: flex-start; }
}
