/* =========================================================
   Simon Langner — design tokens
   Marine blue + organic palette (rebuilt from matilda.fyi
   structure: JetBrains Mono / DM Sans / Caveat, minimalist)
   ========================================================= */
:root {
  /* light, near-white cream background */
  --background: #fbf8f1;
  /* body text: near-black dark gray */
  --foreground: #20282c;
  /* primary accent = marine blue (headings, name, links) */
  --accent-primary: #1d5a7a;
  --accent-primary-deep: #15455e;
  /* organic supporting tones */
  --sage: #6f8f5a;
  --clay: #bf6f4a;
  --sand: #d2a24c;
  --muted: #6a716e;
  /* faint grid line, organic warm */
  --grid-line: rgba(32, 40, 44, 0.08);

  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-heading: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-script: "Caveat", cursive;

  --maxw: 900px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #14222a;
    --foreground: #e8e1d2;
    --accent-primary: #5aa8c6;
    --accent-primary-deep: #82c5dc;
    --grid-line: rgba(232, 225, 210, 0.08);
    --muted: #9aa7a4;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.font-mono { font-family: var(--font-mono); }

/* interactive dot grid + wave layers sit behind the content */
#grid-layer,
#wave-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}
#grid-layer circle { fill: var(--foreground); }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; width: 100%; }

section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

@media (min-width: 768px) {
  section { padding: 5rem 3rem; }
}

/* ---------- hero ---------- */
.hero { padding-top: 6rem; padding-bottom: 9rem; }

@media (min-width: 768px) {
  .hero { padding-top: 8rem; padding-bottom: 12rem; }
}

.hero-scribble {
  font-family: var(--font-script);
  font-size: 1.6rem;
  color: var(--clay);
  display: inline-block;
  margin-bottom: 0.5rem;
  transform: rotate(-3deg);
}

.hero-loc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.hero-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 0.5rem;
  color: var(--accent-primary);
}

.hero-role {
  font-size: 1.1rem;
  margin: 0 0 2rem;
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.78rem;
}

/* ---------- headings ---------- */
.section-head {
  font-family: var(--font-heading);
  color: var(--accent-primary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 2rem;
}

/* ---------- prose & lists ---------- */
.prose p { margin: 0 0 1rem; max-width: 65ch; }

.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { margin: 0 0 0.85rem; }

/* experience / focus / community entries */
.entries { list-style: none; padding: 0; margin: 0; }
.entry {
  padding: 0 0 1.6rem;
  margin: 0 0 1.6rem;
  border-bottom: 1px dashed var(--grid-line);
}
.entry:last-child { border-bottom: 0; margin-bottom: 0; }
.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.entry-title { font-family: var(--font-heading); font-weight: 600; font-size: 1rem; }
.entry .when { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.entry-org { display: block; color: var(--accent-primary); font-size: 0.85rem; margin: 0.15rem 0 0.5rem; }
.entry-desc { margin: 0; max-width: 65ch; font-size: 0.95rem; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0.75rem 0 0; }
.tags li {
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--grid-line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
}

.contact-links { font-size: 0.85rem; }

/* ---------- links ---------- */
a { color: var(--foreground); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-primary); }
a.accent { color: var(--accent-primary); }
a.accent:hover { color: var(--accent-primary-deep); text-decoration: underline; }

/* ---------- footer ---------- */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.7s ease both; }
.animate-delay-150 { animation-delay: 0.15s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
}

/* ---------- self-drawing sea waves ---------- */
.wave path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
}
.wave.is-drawing path {
  animation: drawPath 1s ease forwards;
}
@keyframes drawPath {
  from { stroke-dashoffset: var(--len); }
  to   { stroke-dashoffset: 0; }
}

/* ---------- click hint ---------- */
.draw-hint {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  font-size: 0.7rem;
  color: var(--muted);
  background: var(--background);
  border: 1px solid var(--grid-line);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  opacity: 0.85;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.draw-hint.is-hidden { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .wave.is-drawing path { animation: none; stroke-dashoffset: 0; }
}
