/* ---------- Tokens ---------- */
:root {
  --ink: #0e1320;
  --ink-2: #141b2d;
  --line: #2a3550;
  --text: #e9eef7;
  --muted: #a3aec4;
  --ice: #8fd3ff;
  --ember: #ff7a3d;
  --ice-bg: #0f2438;
  --ember-bg: #2b1710;
  --error: #ff9a9a;

  --font-display: "Dela Gothic One", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 3.8rem;
}

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

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

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

h1, h2, h3 { margin: 0; line-height: 1.15; }

h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  letter-spacing: -0.01em;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}

p { margin: 0 0 1.25rem; max-width: 62ch; }

a { color: var(--ice); text-underline-offset: 0.2em; }
a:hover { color: #b9e5ff; }

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

.wrap {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 5vw;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ice);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.6rem 5vw;
  background: rgba(14, 19, 32, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }

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

.site-nav a {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--text);
  border-bottom-color: var(--ember);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 80vh;
  min-height: max(30rem, calc(100svh - var(--header-h)));
  padding: clamp(2rem, 6vw, 5rem) 5vw;
  background: linear-gradient(90deg, var(--ice-bg) 50%, var(--ember-bg) 50%);
  overflow: hidden;
}

/* The seam: the one animated moment on the page */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: linear-gradient(180deg, var(--ice), var(--ember));
  transform-origin: top;
  animation: seam 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  z-index: -1;
}

.hero-inner { width: 100%; }

.hero-title {
  display: block;
  margin: 0 0 0.75rem;      /* was 0 0 1.5rem */
  padding-bottom: 0.2em;    /* extra room so the "g" tail stays visible */
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 11.5vw, 20rem); /*old values: clamp(2rem, 8.5vw, 8rem)*/
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ice); /* fallback if background-clip is unsupported */
  /* The colour cut sits at 50% of the box, exactly on the hero's seam */
  background: linear-gradient(90deg, var(--ice) 50%, var(--ember) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: title-in 0.6s 0.35s ease-out both;
}

.hero-lead {
  max-width: min(40ch, 40vw);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--text);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.75rem;
}

@keyframes seam {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

@keyframes title-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--ember);
  color: #1c0e07;
}
.btn-primary:hover { background: #ff9060; color: #1c0e07; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  border-color: var(--ice);
  color: var(--ice);
}
.btn-secondary:hover { background: rgba(143, 211, 255, 0.14); color: var(--ice); }

/* ---------- Sections ---------- */
.about,
.contact {
  padding: clamp(3.5rem, 8vw, 7rem) 0;
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--ice) 50%, var(--ember) 50%) 1;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.portrait { margin: 0 12px; }

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  background: var(--ink-2);
  box-shadow: -12px 0 0 var(--ice), 12px 0 0 var(--ember);
}

/* Numbered because it really is a sequence */
.path {
  list-style: none;
  counter-reset: step;
  margin: 0 0 2.5rem 0.75rem;
  padding: 0;
  border-left: 2px solid var(--line);
}

.path li {
  position: relative;
  counter-increment: step;
  padding: 0 0 1.25rem 1.75rem;
  color: var(--muted);
}

.path li:last-child { padding-bottom: 0; }

.path li::before {
  content: counter(step);
  position: absolute;
  left: -0.95rem;
  top: 0.05rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid var(--ice);
  border-radius: 50%;
  background: var(--ink);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

/* The final step is the present, so it takes the ember colour */
.path li:last-child::before { border-color: var(--ember); }

.path strong {
  display: block;
  color: var(--text);
}

.quote { margin: 0; }
.quote p {
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.quote footer { color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.contact-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-links li { margin-bottom: 0.4rem; }

.contact-form { max-width: 34rem; }

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--ink-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.field textarea { resize: vertical; min-height: 8rem; }

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 3px solid var(--ice);
  outline-offset: 1px;
  border-color: var(--ice);
}

.field [aria-invalid="true"] { border-color: var(--error); }

.form-status {
  min-height: 1.7em;
  margin: 1rem 0 0;
  font-weight: 500;
}
.form-status[data-kind="success"] { color: var(--ice); }
.form-status[data-kind="error"] { color: var(--error); }

/* Honeypot field, hidden from people */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 5vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.site-footer p { margin: 0; max-width: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-lead { max-width: 36ch; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .portrait { max-width: 18rem; }
}

@media (max-width: 480px) {
  .site-nav ul { gap: 1rem; }
  .brand { font-size: 1rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
