/* Site styles for the home page and /apps. App detail pages use apps/apps.css. */

:root {
  --teal: #4acaa8;          /* brand color: hero, accents, focus rings */
  --teal-tint: #e3f6f0;     /* chips, subtle highlights */
  --teal-ink: #0f3d31;      /* text on teal backgrounds (5.9:1) */
  --link: #1a7a61;          /* teal for text on white (5.3:1) */
  --heading: #555;
  --text: #666;
  --muted: #6b6b6b;
  --bg: #f2f6f4;           /* page background: soft grey-green so white cards stand out */
  --surface: #fff;          /* cards and white bands */
  --border: #d5dfdb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --topbar-h: 3.5rem;
}

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

html { background: var(--surface); /* fills below the footer on short pages */ scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 1rem); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.7 "Lato", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

img, video { display: block; max-width: 100%; }

h1, h2, h3 { color: var(--heading); font-weight: 700; line-height: 1.2; margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--teal-ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.container { width: min(72rem, 100% - 2rem); margin-inline: auto; }
.narrow { max-width: 46rem; }

.visually-hidden {
  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;
  background: var(--teal-ink); color: #fff; padding: 0.5rem 1rem; border-radius: 6px;
}
.skip-link:focus { top: 0.5rem; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(242, 246, 244, 0.92); /* --bg, slightly see-through */
  backdrop-filter: saturate(1.5) blur(10px);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  width: min(72rem, 100% - 2rem); margin-inline: auto;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { color: var(--heading); font-weight: 900; text-decoration: none; font-size: 1.1rem; }
.brand:hover { color: var(--teal-ink); }

.nav-links { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 0.4rem 0.75rem; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.95rem;
}
.nav-links a:hover { color: var(--teal-ink); background: var(--teal-tint); }
.nav-links a.active { color: var(--teal-ink); background: var(--teal-tint); }

.nav-toggle {
  display: none; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer; position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 50%; width: 1.25rem; height: 2px; margin-left: -0.625rem;
  background: var(--heading); border-radius: 2px; content: ""; transition: transform 0.2s;
}
.nav-toggle-bar { top: 50%; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 40rem) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: var(--topbar-h);
    flex-direction: column; gap: 0; padding: 0.5rem 1rem 1rem;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 1rem; border-radius: 8px; }
}

/* ---------- Hero (profile on the left, About on the right) ---------- */

.hero { --photo: clamp(8rem, 14vw, 11rem); position: relative; background: var(--teal); color: var(--teal-ink); }
.hero-inner {
  display: grid; grid-template-columns: minmax(18rem, 25rem) 1fr; align-items: stretch;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-block: 0 clamp(2.5rem, 6vw, 4rem);
}
/* Profile is a column whose buttons sit at the bottom, so they line up with the bottom of the About panel. */
.hero-profile { display: flex; flex-direction: column; text-align: center; }
.hero-profile .hero-actions { margin-top: auto; }
.hero-photo {
  width: var(--photo); height: auto; aspect-ratio: 1; object-fit: cover; object-position: 50% 30%;
  margin: calc(var(--photo) / -2) auto 1.25rem; /* overlap the banner above */
  position: relative;
  border-radius: 50%; border: 5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 30px rgba(15, 61, 49, 0.25);
}
.hero h1 { color: var(--teal-ink); font-size: clamp(2rem, 1.5rem + 1.8vw, 2.75rem); font-weight: 900; margin: 0 0 0.5rem; }
.hero-role {
  margin: 0 0 0.25rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem;
}
.hero-pitch { font-size: 1.15rem; margin: 0 0 1.5rem; }
.hero-profile .hero-pitch { margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.hero-profile .hero-actions { justify-content: center; }
.hero-actions .button { padding: 0.55rem 1rem; font-size: 0.95rem; }

.hero-about {
  background: #9be2cf; border-radius: var(--radius);   /* teal mixed with white; opaque so the banner doesn't show through */
  box-shadow: 0 8px 30px rgba(15, 61, 49, 0.18);
  padding: clamp(1.25rem, 3vw, 2rem);
  align-self: end;                                     /* bottom lines up with the bottom of the buttons */
  font-size: 1.05rem; line-height: 1.7;
}
.hero-about h2 { color: var(--teal-ink); font-size: 1.5rem; margin-bottom: 0.75rem; }
.hero-about p:last-child { margin-bottom: 0; }

@media (max-width: 52rem) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-about { text-align: left; }
  .hero-profile .hero-actions { margin-top: 0; }
}

.button {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.2rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.35); color: var(--teal-ink);
  font-weight: 700; text-decoration: none; border: 2px solid rgba(15, 61, 49, 0.25);
  transition: background 0.15s, border-color 0.15s;
}
.button:hover { background: rgba(255, 255, 255, 0.6); color: var(--teal-ink); border-color: rgba(15, 61, 49, 0.45); }
.button-primary { background: var(--teal-ink); color: #fff; border-color: var(--teal-ink); }
.button-primary:hover { background: #164f40; color: #fff; border-color: #164f40; }
.hero :focus-visible { outline-color: var(--teal-ink); }


/* ---------- Banner (pixel-art picture above the hero) ---------- */

.banner { background: #eeebe0; line-height: 0; }
.banner video {
  /* Whole picture on narrow screens; capped on wide ones so the hero stays on the first screen. */
  width: 100%; height: min(calc(100vw * 288 / 500), 26rem);
  object-fit: cover; object-position: 50% 70%;
  image-rendering: pixelated; /* keep pixel art crisp when scaled up */
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-white { background: var(--surface); }
/* Back-to-back tinted sections share one band, so don't double the gap between them. */
.section:not(.section-white) + .section:not(.section-white) { padding-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-head a { font-weight: 700; }
.section h2 { margin-bottom: 1.5rem; }
.page-top { padding-top: clamp(2rem, 5vw, 3.5rem); }
.page-title { font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem); margin-bottom: 0.5rem; }
.lead { font-size: 1.2rem; margin-bottom: 2rem; }

/* ---------- Cards ---------- */

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.grid-wide { grid-template-columns: 1fr; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover, .card:focus-within { border-color: var(--teal); box-shadow: var(--shadow), 0 0 0 3px var(--teal-tint); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

.card-media { display: block; position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #eef1f0; }
.card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.1rem 1.15rem; font-size: 0.95rem; line-height: 1.6; }
.card-title { margin: 0 0 0.3rem; font-size: 1.05rem; }
.card-title a { color: var(--heading); text-decoration: none; }
.card-title a:hover { color: var(--teal-ink); }
.card-links { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0 0 0.6rem; font-weight: 700; font-size: 0.9rem; }
.card-summary { margin: 0 0 0.6rem; }
.card-status { margin: 0 0 0.6rem; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: auto 0 0; padding: 0.25rem 0 0; }
.tags li {
  font-size: 0.8rem; font-weight: 700; color: var(--teal-ink);
  background: var(--teal-tint); padding: 0.15rem 0.6rem; border-radius: 999px;
}

@media (min-width: 48rem) {
  .card-wide { flex-direction: row; }
  .card-wide .card-media { flex: 0 0 42%; aspect-ratio: 16 / 10; }
  .card-wide .card-media img, .card-wide .card-media video { object-fit: cover; }
  .card-wide .card-body { justify-content: center; padding: 1.5rem 1.75rem; font-size: 1rem; }
  .card-wide .card-title { font-size: 1.25rem; }
  .card-wide .tags { margin-top: 0.25rem; }
}

/* ---------- Contact ---------- */

.contact { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.newsletter { min-height: 12rem; } /* reserve space while the MailerLite form loads */

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

.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding-block: 1.5rem; font-size: 0.95rem; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.social { display: flex; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.social a {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  color: var(--text);
}
.social a:hover { color: var(--teal-ink); background: var(--teal-tint); }
.button svg { flex: none; }

/* ---------- App pages (apps/<name>/*.md) ---------- */

.app-header {
  display: inline-flex; align-items: center; gap: 1rem; margin-bottom: 2rem;
  color: var(--text); text-decoration: none; line-height: 1.4;
}
.app-header img { width: 72px; height: 72px; }
.app-header strong { color: var(--heading); font-size: 1.15rem; }
.app-header:hover strong { color: var(--teal-ink); }
.app-page h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.6rem); margin-bottom: 0.25rem; }
.app-page .prose h2 { font-size: 1.2rem; margin: 2rem 0 0.4rem; }
.prose ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose strong { color: var(--heading); }
.muted { color: var(--muted); }
.screenshot { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); margin: 0.5rem 0 1.5rem; }
.badge {
  display: inline-block; padding: 0.55rem 1.1rem; border-radius: 999px;
  background: var(--teal-tint); color: var(--teal-ink); font-weight: 700;
}
.app-subnav {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border);
  font-weight: 700; font-size: 0.95rem;
}
.app-subnav a[aria-current="page"] { color: var(--heading); text-decoration: none; }

/* Outline button for light backgrounds (the hero buttons assume teal behind them). */
.button-outline { background: transparent; border-color: var(--border); color: var(--teal-ink); }
.button-outline:hover { background: var(--teal-tint); border-color: var(--teal); }
