/* danielhorn.ch – provisional brand tokens from dhc/CLAUDE.md */

@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-500.ab4861869c91.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-700.f9e147a59a93.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-400.77bc02670657.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-400-italic.ac3e6cdbce96.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-500.f7016cd446d2.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-600.196e3cbc5fee.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-400.79936b18df9f.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --navy: #14283C;
  --navy-deep: #0E1E2E;
  --navy-line: #2A3F55;
  --copper: #A85A1E;
  --copper-light: #E39A5C;
  --paper: #F4F6F8;
  --white: #FFFFFF;
  --ink: #14283C;
  --muted: #55667A;
  --line: #D6DEE6;
  --on-navy: #E8EEF4;
  --on-navy-muted: #A9B8C7;
  --danger: #B42318;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --container: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 10vw, 7.5rem);
  --header-h: 4.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 0.6em; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
h3 { font-size: 1.375rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
a { color: var(--copper); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--copper-light); outline-offset: 3px; border-radius: 2px; }
svg { display: block; flex-shrink: 0; }
address { font-style: normal; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; padding: 0.5rem 1rem; background: var(--white); color: var(--navy); }
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  font: 600 1rem/1 var(--font-body);
  color: var(--white); background: var(--copper);
  border: 1px solid var(--copper); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: #8F4C17; border-color: #8F4C17; }
.btn-small { padding: 0.6rem 1.1rem; font-size: 0.9375rem; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: currentColor; }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn-spinner { display: none; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
.htmx-request .btn-spinner, .btn.htmx-request .btn-spinner { display: inline-block; }

/* Header ---------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  color: var(--on-navy);
  transition: background-color 0.3s, box-shadow 0.3s;
}
.site-header.is-scrolled { background: rgba(20, 40, 60, 0.96); box-shadow: 0 1px 0 var(--navy-line); backdrop-filter: blur(8px); }
.page-sub .site-header { background: var(--navy); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { display: flex; align-items: center; gap: 0.7rem; color: inherit; text-decoration: none; }
.brand-text { font-family: var(--font-display); font-size: 1.125rem; line-height: 1; }
.brand-text strong { font-weight: 700; }
.brand-text span { font-weight: 500; color: var(--on-navy-muted); }
.site-nav ul { display: flex; align-items: center; gap: 2rem; margin: 0; padding: 0; list-style: none; }
.site-nav a:not(.btn) { color: inherit; text-decoration: none; font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--copper-light); }
.nav-toggle { display: none; padding: 0.4rem; color: inherit; background: none; border: 0; cursor: pointer; }

@media (max-width: 47.99rem) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; inset: var(--header-h) 0 auto;
    background: var(--navy); border-bottom: 1px solid var(--navy-line);
    padding: 0.5rem var(--gutter) 1.5rem;
    visibility: hidden; opacity: 0; transform: translateY(-0.5rem);
    transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0s 0.2s;
  }
  .site-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity 0.2s, transform 0.2s var(--ease); }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li a:not(.btn) { display: block; padding: 0.9rem 0; border-bottom: 1px solid var(--navy-line); }
  .site-nav .btn { margin-top: 1.25rem; justify-content: center; }
}

/* Hero ------------------------------------------------------------------ */
.hero {
  position: relative; overflow: hidden;
  min-height: min(100svh, 52rem);
  display: flex; align-items: center;
  padding: calc(var(--header-h) + 3rem) 0 4rem;
  color: var(--on-navy);
  background:
    radial-gradient(circle at 78% 45%, rgba(227, 154, 92, 0.09), transparent 42%),
    var(--navy);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 {
  font-size: clamp(2.75rem, 7.2vw, 5.75rem);
  line-height: 0.98; letter-spacing: -0.035em;
  max-width: 10ch; margin-bottom: 2rem;
  animation: rise 0.9s var(--ease) both;
}
.hero-lead { max-width: 34em; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--on-navy-muted); animation: rise 0.9s 0.12s var(--ease) both; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.25rem; animation: rise 0.9s 0.24s var(--ease) both; }
.hero .btn:not(.btn-ghost) { background: var(--copper-light); border-color: var(--copper-light); color: var(--navy); }
.hero .btn:not(.btn-ghost):hover { background: #F0B07A; border-color: #F0B07A; }

/* The bridge: business and technology joined inside the circle mark. One orchestrated draw, then a slow runner. */
.bridge { margin: 0; }
.bridge svg { width: 100%; max-width: 30rem; height: auto; margin-inline: auto; overflow: visible; }
.bridge-ring, .bridge-deck, .bridge-arch, .bridge-hangers line { fill: none; stroke-linecap: round; }
.bridge-ring { stroke: rgba(232, 238, 244, 0.22); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s 0.2s var(--ease) forwards; transform-origin: center; }
.bridge-deck { stroke: var(--on-navy-muted); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s 0.9s var(--ease) forwards; }
.bridge-arch { stroke: var(--copper-light); stroke-width: 3; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.2s 1.3s var(--ease) forwards; }
.bridge-hangers line { stroke: var(--on-navy-muted); stroke-width: 1.25; opacity: 0; animation: fade 0.5s calc(1.9s + var(--i) * 0.08s) forwards; }
.bridge-ends circle { fill: var(--navy); stroke: var(--copper-light); stroke-width: 2.5; opacity: 0; animation: fade 0.4s 1.2s forwards; }
.bridge-labels text { font: 400 15px var(--font-mono); fill: var(--on-navy-muted); opacity: 0; animation: fade 0.6s 2.1s forwards; }
.bridge-runner { fill: var(--white); opacity: 0; animation: fade 0.4s 2.6s forwards; filter: drop-shadow(0 0 6px rgba(227, 154, 92, 0.9)); }

@media (max-width: 47.99rem) {
  .hero { min-height: auto; padding-top: calc(var(--header-h) + 2.5rem); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .bridge { order: -1; }
  .bridge svg { max-width: 15rem; margin-inline: 0; }
}

/* Services -------------------------------------------------------------- */
.services { background: var(--paper); }
.services-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.services-intro > p { color: var(--muted); max-width: 30em; }
.service-tabs { display: flex; flex-direction: column; margin-top: 2rem; border-top: 1px solid var(--line); }
.service-tabs button {
  position: relative;
  display: flex; align-items: center; gap: 0.9rem;
  width: 100%; padding: 1.15rem 0 1.15rem 1.25rem;
  font: 500 1.125rem/1.3 var(--font-display); text-align: left; color: var(--muted);
  background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: color 0.2s;
}
.service-tabs button::before {
  content: ""; position: absolute; left: 0; top: 0.9rem; bottom: 0.9rem; width: 3px;
  background: var(--copper); border-radius: 2px;
  transform: scaleY(0); transition: transform 0.35s var(--ease);
}
.service-tabs button:hover { color: var(--ink); }
.service-tabs button.is-active { color: var(--ink); }
.service-tabs button.is-active::before { transform: scaleY(1); }
.service-tabs button.is-active svg { color: var(--copper); }

.service-panels { display: grid; }
.service-panel {
  grid-area: 1 / 1;
  padding: clamp(1.75rem, 4vw, 3rem);
  background: var(--white);
  border: 1px solid var(--line); border-radius: 6px;
}
.service-panel h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.service-lead { font-size: 1.125rem; color: var(--muted); max-width: 32em; }
.checklist { list-style: none; margin: 1.75rem 0 0; padding: 0; }
.checklist li { display: flex; gap: 0.75rem; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.checklist svg { color: var(--copper); margin-top: 0.22rem; }
.panel-enter { transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.panel-enter-start { opacity: 0; transform: translateY(0.75rem); }
.panel-enter-end { opacity: 1; transform: none; }

@media (max-width: 47.99rem) {
  .services-grid { grid-template-columns: minmax(0, 1fr); }
  .service-tabs { flex-direction: row; overflow-x: auto; border-top: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .service-tabs button { flex: 0 0 auto; width: auto; padding: 0.9rem 1rem; border-bottom: 0; font-size: 1rem; }
  .service-tabs button::before { left: 1rem; right: 1rem; top: auto; bottom: -1px; width: auto; height: 3px; transform: scaleX(0); }
  .service-tabs button.is-active::before { transform: scaleX(1); }
}

/* Process --------------------------------------------------------------- */
.process { background: var(--white); border-block: 1px solid var(--line); }
.steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem;
  margin: 3rem 0 0; padding: 0; list-style: none;
}
/* Each step draws the connector to the next one; delays chain them left to right when the section enters view. */
.process-intro p { max-width: 40em; font-size: 1.125rem; color: var(--muted); }
.step { position: relative; }
.step:not(:last-child)::before, .step:not(:last-child)::after {
  content: ""; position: absolute; top: calc(1.25rem - 1px); left: 2.5rem; right: -2rem; height: 2px;
}
.step::before { background: var(--line); }
.step::after { background: var(--copper); transform-origin: left; transform: scaleX(0); transition: transform 0.4s linear; transition-delay: calc(var(--i) * 0.4s + 0.15s); }
.is-seen .step::after { transform: scaleX(1); }
.step-no {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; margin-bottom: 1.5rem;
  font: 400 1rem var(--font-mono); color: var(--muted);
  background: var(--white); border: 2px solid var(--line); border-radius: 50%;
  transition: border-color 0.3s, color 0.3s, background-color 0.3s;
  transition-delay: calc(var(--i) * 0.4s);
}
.is-seen .step-no { border-color: var(--copper); color: var(--white); background: var(--copper); }
.step p { color: var(--muted); max-width: 22em; }

@media (max-width: 47.99rem) {
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .step { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: 1.25rem; padding-bottom: 1.5rem; }
  .step:not(:last-child)::before, .step:not(:last-child)::after { top: 2.5rem; bottom: 0; left: calc(1.25rem - 1px); right: auto; width: 2px; height: auto; }
  .step::after { transform-origin: top; transform: scaleY(0); }
  .is-seen .step::after { transform: scaleY(1); }
  .step-no { grid-row: span 2; margin: 0; }
  .step h3 { margin: 0.45rem 0 0.4rem; }
}

/* About ----------------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.about-text p { max-width: 36em; font-size: 1.125rem; }
.about-facts h3 { font-size: 1.125rem; margin-bottom: 0.75rem; }
.about-facts h3:not(:first-child) { margin-top: 2.5rem; }
.education { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--navy); }
.education li { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.education strong { font-weight: 500; line-height: 1.35; }
.education span { color: var(--muted); font-size: 0.9375rem; }
.terms { margin: 0; border-top: 2px solid var(--navy); }
.terms div { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.terms dt { color: var(--muted); }
.terms dd { margin: 0; font-family: var(--font-mono); text-align: right; }
.experience-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 6vw, 5rem); margin-top: clamp(3rem, 7vw, 5rem); }
.experience { padding-top: 1.5rem; border-top: 1px solid var(--line); }
.experience > p { color: var(--muted); max-width: 32em; }
.app-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.app-list li { padding: 0.7rem 0; border-top: 1px solid var(--line); }

@media (max-width: 47.99rem) {
  .about-grid, .experience-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Contact --------------------------------------------------------------- */
.contact { color: var(--on-navy); background: var(--navy); }
.contact a { color: var(--copper-light); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.contact-intro p { color: var(--on-navy-muted); }
.contact-direct { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.5rem; }
.contact-page { padding-top: calc(var(--header-h) + var(--section-y)); min-height: 80vh; }

.contact-form { display: grid; gap: 1.25rem; }
.field label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.9375rem; }
.field input[type=text], .field input[type=email], .field textarea {
  width: 100%; padding: 0.8rem 0.95rem;
  font: inherit; color: var(--on-navy);
  background: var(--navy-deep); border: 1px solid var(--navy-line); border-radius: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--copper-light); box-shadow: 0 0 0 3px rgba(227, 154, 92, 0.25); }
.field-check { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; }
.field-check input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: var(--copper-light); }
.field-check label { margin: 0; font-weight: 400; color: var(--on-navy-muted); }
.field-check .field-error { grid-column: 2; }
.has-error input, .has-error textarea { border-color: #F08A7E; }
.field-error { margin: 0.35rem 0 0; font-size: 0.875rem; color: #F5A39A; }
.form-alert { display: flex; gap: 0.6rem; align-items: center; padding: 0.8rem 1rem; color: #FDE2DE; background: rgba(180, 35, 24, 0.25); border: 1px solid rgba(240, 138, 126, 0.5); border-radius: 6px; }
.contact-form .btn { justify-self: start; background: var(--copper-light); border-color: var(--copper-light); color: var(--navy); }
.contact-form .btn:hover { background: #F0B07A; border-color: #F0B07A; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.contact-success { padding: 2.5rem; border: 1px solid var(--navy-line); border-radius: 6px; animation: rise 0.6s var(--ease) both; }
.contact-success svg { color: var(--copper-light); margin-bottom: 1rem; }
.contact-success p { color: var(--on-navy-muted); margin: 0; }

@media (max-width: 47.99rem) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Legal pages ----------------------------------------------------------- */
.legal { padding-top: calc(var(--header-h) + var(--section-y)); background: var(--white); }
.prose { max-width: 46rem; }
.prose h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin-bottom: 1rem; }
.prose h2 { font-size: 1.375rem; margin-top: 2.5rem; margin-bottom: 0.6rem; }
.prose address { margin-bottom: 1em; }
.legal-meta { color: var(--muted); font-family: var(--font-mono); font-size: 0.875rem; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; }

/* Password gate --------------------------------------------------------- */
.page-gate { background: var(--navy); color: var(--on-navy); }
.gate { min-height: 100svh; display: grid; place-items: center; padding: 2rem var(--gutter); }
.gate-card { width: 100%; max-width: 28rem; }
.gate-card .brand { margin-bottom: 3rem; }
.gate-card h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
.gate-card > p { color: var(--on-navy-muted); }
.gate-form { display: grid; gap: 1.25rem; margin-top: 2rem; }
.gate-form .field input { width: 100%; padding: 0.8rem 0.95rem; font: inherit; color: var(--on-navy); background: var(--navy-deep); border: 1px solid var(--navy-line); border-radius: 6px; }
.gate-form .field input:focus { outline: none; border-color: var(--copper-light); box-shadow: 0 0 0 3px rgba(227, 154, 92, 0.25); }
.gate-form .btn { justify-self: start; background: var(--copper-light); border-color: var(--copper-light); color: var(--navy); }
.gate-form .btn:hover { background: #F0B07A; border-color: #F0B07A; }
.gate-contact { margin-top: 3rem; font-size: 0.9375rem; }
.gate-contact a { color: var(--copper-light); }

/* Footer ---------------------------------------------------------------- */
.site-footer { padding-block: 2.5rem; color: var(--on-navy-muted); background: var(--navy-deep); font-size: 0.9375rem; }
.site-footer a { color: var(--on-navy); text-decoration: none; }
.site-footer a:hover { color: var(--copper-light); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem; }
.footer-inner p { margin: 0; }
.footer-brand strong { color: var(--on-navy); font-family: var(--font-display); }
.footer-links { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }

/* Motion ---------------------------------------------------------------- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(1rem); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .bridge-runner { display: none; }
}
