/* John Silver AI — site styles
   System fonts only. No external requests.
   Colors switch with prefers-color-scheme. */

:root {
  color-scheme: light dark;

  --bg: #f3f1ec;
  --bg-elevated: #fffcf8;
  --ink: #16181b;
  --ink-muted: #5a5f66;
  --line: #d6d2c9;
  --accent: #1b5f56;
  --accent-hover: #144840;
  --accent-soft: #e3efed;
  --accent-ink: #ffffff;
  --card: #fffcf8;
  --placeholder-a: #d7ece8;
  --placeholder-b: #c9d4e0;
  --placeholder-c: #e8e0d2;
  --placeholder-d: #d4c9dc;
  --shadow: 0 1px 2px rgba(22, 24, 27, 0.05), 0 10px 28px rgba(22, 24, 27, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 4.25rem;
  --max: 70rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e10;
    --bg-elevated: #14171a;
    --ink: #eeeae4;
    --ink-muted: #9b9fa6;
    --line: #2a2e33;
    --accent: #7dcec4;
    --accent-hover: #9ad9d1;
    --accent-soft: #16312e;
    --accent-ink: #0c0e10;
    --card: #161a1e;
    --placeholder-a: #1a3330;
    --placeholder-b: #1e2a38;
    --placeholder-c: #2a261e;
    --placeholder-d: #2a2230;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
}

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

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 0% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 50%);
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus {
  outline: none;
}

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

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.5rem 0.85rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
  outline-offset: 2px;
}

.wrap {
  width: min(var(--max), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

/* Header
   ------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-size: 1.02rem;
}

.wordmark:hover {
  color: var(--ink);
}

.mark {
  width: 1.85rem;
  height: 1.85rem;
  flex-shrink: 0;
}

.mark .bg {
  fill: var(--accent);
}

.mark .fg {
  fill: var(--accent-ink);
}

.mark .dot {
  fill: var(--accent-ink);
  opacity: 0.85;
}

@media (prefers-color-scheme: dark) {
  .mark .bg {
    fill: var(--accent-soft);
    stroke: var(--accent);
    stroke-width: 1.25;
  }
  .mark .fg,
  .mark .dot {
    fill: var(--accent);
    opacity: 1;
  }
}

.wordmark-ai {
  color: var(--accent);
  font-weight: 650;
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}

.nav-toggle-bars {
  display: block;
  width: 1.2rem;
  height: 0.75rem;
  position: relative;
}

.nav-toggle-bars span,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}

.nav-toggle-bars::before {
  top: 0;
}

.nav-toggle-bars span {
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle-bars::after {
  bottom: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars span {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

.site-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.site-nav a:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

@media (max-width: 47.99rem) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1rem;
    display: none;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0.15rem;
  }

  .site-nav a {
    display: block;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* Hero
   ------------------------------------------------------------------ */

.hero {
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(3.5rem, 8vw, 6.5rem);
}

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

@media (min-width: 60rem) {
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
  }
}

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.6rem, 8vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.hero h1 .wordmark-ai {
  font-weight: inherit;
}

.lede {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(1.1rem, 2vw, 1.28rem);
  line-height: 1.5;
  color: var(--ink-muted);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--ink);
  border-color: transparent;
}

.contact-plain {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.98rem;
}

.contact-plain:hover {
  color: var(--accent);
}

.hero-panel {
  position: relative;
  min-height: 16rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-art {
  width: 100%;
  height: 100%;
  min-height: 18rem;
  display: block;
}

/* Sections
   ------------------------------------------------------------------ */

.section {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 0.75rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  max-width: 40rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.4vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* Services
   ------------------------------------------------------------------ */

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 48rem) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

.card-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

/* Media gallery
   ------------------------------------------------------------------ */

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 40rem) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tile {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.tile img,
.tile video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg);
}

.tile figcaption {
  padding: 0.7rem 1rem 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg);
}

.embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.placeholder-tile {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1.25rem;
  color: var(--ink-muted);
  position: relative;
  overflow: hidden;
}

.placeholder-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%),
    linear-gradient(145deg, var(--ph-a, var(--placeholder-a)), var(--ph-b, var(--placeholder-b)));
}

.placeholder-tile:nth-child(1) {
  --ph-a: var(--placeholder-a);
  --ph-b: var(--placeholder-c);
}

.placeholder-tile:nth-child(2) {
  --ph-a: var(--placeholder-b);
  --ph-b: var(--placeholder-d);
}

.placeholder-tile:nth-child(3) {
  --ph-a: var(--placeholder-c);
  --ph-b: var(--placeholder-a);
}

.placeholder-tile:nth-child(4) {
  --ph-a: var(--placeholder-d);
  --ph-b: var(--placeholder-b);
}

.placeholder-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
}

.placeholder-inner svg {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--ink);
  opacity: 0.72;
}

.placeholder-inner span {
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink);
}

.placeholder-inner small {
  font-size: 0.75rem;
  max-width: 14rem;
}

/* About + contact
   ------------------------------------------------------------------ */

.split {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 52rem) {
  .split {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 3rem;
    align-items: start;
  }
}

.prose p {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  max-width: 40rem;
  font-size: 1.08rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.contact-block {
  margin-top: 0.25rem;
}

.contact-email {
  display: inline-block;
  margin: 0.35rem 0 1.25rem;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-email:hover {
  color: var(--accent);
}

/* Footer
   ------------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.25rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

/* 404
   ------------------------------------------------------------------ */

.page-status {
  padding: clamp(4rem, 12vw, 8rem) 0;
  min-height: calc(100vh - var(--header-h) - 6rem);
}

.page-status h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.page-status p {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
  max-width: 28rem;
}

/* Prefers reduced motion
   ------------------------------------------------------------------ */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
