/* meltemisoftware.com — built on the Meltemi Design System (tokens.json v1, with sea). */

@font-face {
  font-family: Geist;
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---- Tokens ------------------------------------------------------------ */

:root {
  --surface-page: #fcfcfc;
  --surface-card: #ffffff;
  --surface-sunken: #f4f4f4;
  --hairline: #e6e6e6;
  --ink: #161616;
  --ink-muted: #5c5c5c;
  --ink-subtle: #737373;
  --orange: #ee7631;
  --amber: #fdda8c;
  --orange-text: #b4521a;
  --focus-ring: #ee7631;
  --sea: #8cc0e0;
  --ink-on-sea: #161616;

  --font-sans: Geist, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  color-scheme: light;
}

/* Dark: follows the OS unless the visitor picked a theme with the toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface-page: #121212;
    --surface-card: #1b1b1b;
    --surface-sunken: #0d0d0d;
    --hairline: #2b2b2b;
    --ink: #f5f5f5;
    --ink-muted: #b0b0b0;
    --ink-subtle: #8a8a8a;
    --orange-text: #ee7631;
    --sea: #2a5470;
    --ink-on-sea: #f5f5f5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface-page: #121212;
  --surface-card: #1b1b1b;
  --surface-sunken: #0d0d0d;
  --hairline: #2b2b2b;
  --ink: #f5f5f5;
  --ink-muted: #b0b0b0;
  --ink-subtle: #8a8a8a;
  --orange-text: #ee7631;
  --sea: #2a5470;
  --ink-on-sea: #f5f5f5;
  color-scheme: dark;
}

/* ---- Base -------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.fill-ink { fill: var(--ink); }
.fill-page { fill: var(--surface-page); }

/* ---- Layout ------------------------------------------------------------ */

.page {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  color: var(--ink-muted);
}

/* Header stays put while the page scrolls. Flat on purpose: just the page
   colour behind it (so text doesn't show through), no border or shadow. It
   bleeds into the side gutters so nothing peeks out at the edges. */
header.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 calc(-1 * var(--space-6));
  padding: 28px var(--space-6);
  background: var(--surface-page);
}
footer.bar { padding: 28px 0 36px; }

/* ---- Theme toggle ------------------------------------------------------ */

.theme-toggle {
  width: 44px;
  height: 44px;
  margin: -12px -12px -12px 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--radius-full);
  color: var(--ink-muted);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-sunken); color: var(--ink); }
.theme-toggle .icon-sun { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

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

.hero {
  padding: 96px 0 72px;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.wordmark { margin: 0; line-height: 0; }
/* 90% of the original 520px / full-width size. */
.wordmark svg { display: block; width: min(90%, 468px); height: auto; }

.lead {
  margin: 0;
  max-width: 504px;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ---- Projects ---------------------------------------------------------- */

.projects {
  padding: 0 0 96px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.label {
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
}

.project {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4) 20px;
  padding: 20px 0;
}
a.project:hover { text-decoration: none; }
a.project:hover .project-link { text-decoration: underline; text-underline-offset: 3px; }
a.project:focus-visible { outline-offset: 4px; border-radius: var(--radius-md); }

.project-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  font-weight: 650;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.035em;
}
.project-name svg { flex: none; }

.project-body {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-desc { color: var(--ink-muted); }

/* Heartbeat line: holds its height so nothing shifts when it fills in. */
.heartbeat {
  min-height: 1.4em;
  font-weight: 400;
  color: var(--ink-subtle);
  opacity: 0;
  transition: opacity 240ms ease;
}
.heartbeat.is-loaded { opacity: 1; }

.heartbeat .pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 8px 1px 0;
  border-radius: var(--radius-full);
  background: var(--orange);
  vertical-align: middle;
}

.project-link,
.project-soon {
  font-size: 13px;
  font-weight: 400;
}
.project-link { color: var(--orange-text); }
.project-soon { color: var(--ink-muted); }

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

.contact {
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact img { display: block; }
.contact a { color: var(--ink-muted); }
.contact a:hover { color: var(--ink); }

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 560px) {
  .page { padding: 0 var(--space-4); }
  header.bar { margin: 0 calc(-1 * var(--space-4)); padding: 20px var(--space-4); }
  .hero { padding: 56px 0 48px; gap: var(--space-6); }
  .lead { font-size: 16px; }
  .projects { padding-bottom: var(--space-16); }
  .project { gap: var(--space-3); }
  .project-body { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .heartbeat { transition: none; }
}

.link { color: var(--orange-text); text-decoration: underline; text-underline-offset: 3px; }
