/* hio-mitos.github.io — portfolio homepage only.
   Deliberately its own look: warm paper, ink, serif headings. Each app card picks up
   that app's own accent colour so the list previews where each link leads.
   System fonts only — no web fonts, so the homepage makes no third-party requests. */

:root {
  color-scheme: light dark;
  --bg: #F5F2EC;
  --surface: #FFFDF9;
  --text: #1B1A17;
  --muted: #6B675F;
  --line: #E2DDD3;
  --ink: #1B1A17;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --surface: #1D1B18; --text: #ECE8E1; --muted: #A39E95; --line: #2E2B27; --ink: #ECE8E1;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --surface: #1D1B18; --text: #ECE8E1; --muted: #A39E95; --line: #2E2B27; --ink: #ECE8E1;
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* Per-app accents, light then dark */
.app-authbox        { --app: #0f9d77; --app-deep: #0b7a5c; }
.app-clipboard-typer{ --app: #2F6FED; --app-deep: #1D4FCF; }
.app-space-analyzer { --app: #D97706; --app-deep: #B45309; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-authbox         { --app: #2dd4a7; }
  :root:not([data-theme="light"]) .app-clipboard-typer { --app: #79A6FF; }
  :root:not([data-theme="light"]) .app-space-analyzer  { --app: #F5A524; }
}
:root[data-theme="dark"] .app-authbox         { --app: #2dd4a7; }
:root[data-theme="dark"] .app-clipboard-typer { --app: #79A6FF; }
:root[data-theme="dark"] .app-space-analyzer  { --app: #F5A524; }

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0 20px 80px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 760px; margin: 0 auto; }
a { color: inherit; }

/* ---------- Masthead ---------- */

.masthead { padding: 72px 0 36px; border-bottom: 1px solid var(--line); }
.kicker {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.kicker svg { width: 18px; height: 18px; }
.masthead h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 8vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.masthead .intro {
  margin: 18px 0 0;
  max-width: 34em;
  font-size: 18px;
  color: var(--muted);
}

/* ---------- App list ---------- */

.section-label {
  margin: 40px 0 14px;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.apps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }

.app {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 24px 20px 30px;
  overflow: hidden;
}
.app::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: var(--app);
}
.app-head { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.tile {
  width: 52px; height: 52px; flex: none;
  border-radius: 13px;
  background: linear-gradient(160deg, var(--app), var(--app-deep));
  display: grid; place-items: center;
}
.tile svg { width: 28px; height: 28px; }
.tile.logo { background: none; }
.tile.logo img { width: 100%; height: 100%; display: block; }
.app h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; line-height: 1.15; }
.app-head:hover h2 { color: var(--app); }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.blurb { margin: 14px 0 0; }

.app-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 16px 0 0; font-size: 14px; }
.app-links a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--line); }
.app-links a:hover { color: var(--app); border-color: var(--app); }
.app-links a.store {
  color: #fff; background: var(--app-deep);
  border: 0; border-radius: 4px; padding: 3px 12px; font-weight: 600;
}
.app-links a.store:hover { color: #fff; filter: brightness(1.12); }

/* ---------- Portfolio: page nav ---------- */

.page-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 26px 0 0; font-size: 15px; }
.page-nav a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.page-nav a:hover { border-color: var(--ink); }

section[id] { scroll-margin-top: 24px; }
.section-title {
  margin: 56px 0 6px;
  font-family: var(--serif);
  font-size: 30px; font-weight: 600; letter-spacing: -0.01em;
}
.section-intro { margin: 0 0 18px; color: var(--muted); }
.group-label {
  margin: 30px 0 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Portfolio: status chip and latest line ---------- */

.app-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.status {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.status.live { border-color: color-mix(in srgb, var(--app, var(--ink)) 45%, var(--line)); color: var(--app, var(--ink)); }
.status.wip { border-style: dashed; }
.app .latest { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.app .latest a { color: var(--text); }

/* Projects without their own colour (websites, experiments) */
.app-neutral { --app: #6B675F; --app-deep: #3F3C37; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-neutral { --app: #A39E95; }
}
:root[data-theme="dark"] .app-neutral { --app: #A39E95; }

/* ---------- Portfolio: timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--app, var(--ink)); border: 2px solid var(--bg);
}
.timeline time { display: block; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.timeline .what { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.timeline .what a { text-decoration: none; }
.timeline .what a:hover { color: var(--app); }
.timeline p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- Portfolio: about ---------- */

.about p { max-width: 38em; font-size: 17px; }

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

footer {
  margin-top: 56px; padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
footer p { margin: 0 0 6px; }
footer a { color: var(--text); }

/* ---------- Theme toggle (drawn by assets/theme.js) ---------- */

.theme-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 38px; height: 38px; padding: 0;
  display: grid; place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

@media (max-width: 520px) {
  .masthead { padding-top: 56px; }
  .app { padding: 18px 18px 18px 24px; }
  .app h2 { font-size: 22px; }
  .theme-toggle { top: 10px; right: 10px; width: 34px; height: 34px; }
}
