/* Casual Planets — static site, 2026 */
:root {
  --bg: #2f3520;
  --bg-elev: #3a4128;
  --bg-card: #25272a;
  --bg-header: rgba(37, 39, 42, 0.92);
  --bg-footer: #1a1e14;
  --text: #d6dbd8;
  --heading: #eef1ef;
  --muted: #b0b8ae;
  --accent: #c4d46a;
  --accent-2: #d0e078;
  --accent-ink: #1a1e14;
  --accent-dim: rgba(196, 212, 106, 0.16);
  --accent-line: rgba(196, 212, 106, 0.38);
  --line: rgba(238, 241, 239, 0.1);
  --line-strong: rgba(238, 241, 239, 0.18);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1120px;
  --header-h: 4.75rem;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: Economica, "Source Sans 3", system-ui, sans-serif;
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

@font-face {
  font-family: Economica;
  src: url("/assets/fonts/Economica-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Economica;
  src: url("/assets/fonts/Economica-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(196, 212, 106, 0.10), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(80, 90, 40, 0.28), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><g fill='%23eef1ef'><circle cx='8' cy='22' r='0.7' opacity='0.35'/><circle cx='48' cy='90' r='0.6' opacity='0.25'/><circle cx='120' cy='18' r='0.8' opacity='0.4'/><circle cx='140' cy='110' r='0.5' opacity='0.22'/><circle cx='80' cy='50' r='0.5' opacity='0.2'/><circle cx='30' cy='140' r='0.6' opacity='0.28'/></g></svg>");
  opacity: 1;
}

body > * { position: relative; z-index: 1; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-2); }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  color: var(--heading);
}
h1 { font-size: clamp(2rem, 4.6vw, 3.25rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); }
h3 { font-size: 1.15rem; letter-spacing: 0.06em; }

.wrap {
  width: min(var(--wrap), calc(100% - 2rem));
  margin-inline: auto;
}
.wrap-narrow { width: min(760px, calc(100% - 2rem)); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 0.75rem; outline: none; box-shadow: var(--focus); }

:focus-visible { outline: none; box-shadow: var(--focus); }
.nav a:focus-visible,
.btn:focus-visible,
.icon-link:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}
.logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.logo img {
  height: 58px;
  width: auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem 1.35rem;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-toggle {
  display: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-2);
  color: var(--accent-ink);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Hero & sections */
main { flex: 1; }
.hero {
  padding: 3.2rem 0 3.5rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}
.lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 38rem;
  margin-bottom: 1.6rem;
}
.hero-photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 5;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo figcaption,
.photo-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 2.2rem 1rem 0.85rem;
  background: linear-gradient(transparent, rgba(37, 39, 42, 0.92));
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.section { padding: 3.5rem 0; }
.section-alt {
  background: linear-gradient(180deg, rgba(58, 65, 40, 0.72), rgba(58, 65, 40, 0.25));
  border-block: 1px solid var(--line);
}
.section-head {
  max-width: 38rem;
  margin-bottom: 2rem;
}
.section-head p { color: var(--muted); }
.kicker {
  display: inline-block;
  height: 3px;
  width: 2.4rem;
  background: var(--accent);
  margin-bottom: 0.9rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.card-media {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #1a1c1e;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.25rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; gap: 0.55rem; }
.card-body h3 { margin: 0; }
.card-body p { color: var(--muted); font-size: 1.05rem; }
.card-link {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.question-list {
  display: grid;
  gap: 1rem;
}
.question {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.25rem;
  color: var(--text);
  margin: 0;
}

/* Project / article */
.project {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 3rem;
}
.project:last-child { margin-bottom: 0; }
.project.reverse { grid-template-columns: 0.9fr 1.1fr; }
.project.reverse .project-copy { order: 2; }
.project-photo {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 0;
}
.project-photo img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }
.meta {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.5rem;
  align-items: start;
}
.contact-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.contact-list li { margin: 0 0 1.1rem; }
.contact-list span {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.contact-list a, .contact-list p {
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  margin: 0;
}
.contact-list a:hover { color: var(--accent); }

form.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.4rem 1.5rem;
  display: grid;
  gap: 0.9rem;
}
.field { display: grid; gap: 0.35rem; }
label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
input, textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font: inherit;
  font-size: 1.05rem;
}
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
  outline: none;
}
textarea { min-height: 9rem; resize: vertical; }
.form-note { font-size: 0.95rem; color: var(--muted); }

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-footer);
  padding: 2.4rem 0 1.6rem;
  color: var(--muted);
  font-size: 1rem;
}
.foot {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
}
.foot .logo img { height: 52px; margin-bottom: 0.8rem; }
.foot h2 {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--heading);
  margin-bottom: 0.7rem;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 0 0 0.4rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }
.legal {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.92rem;
}

/* 404 */
.page-hero { padding: 2.6rem 0 1.5rem; }
.prose { max-width: 42rem; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-left: 1.15rem; }
.todo-note {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.98rem;
  background: var(--accent-dim);
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (max-width: 860px) {
  .hero-grid,
  .project,
  .project.reverse,
  .contact-grid,
  .foot {
    grid-template-columns: 1fr;
  }
  .project.reverse .project-copy { order: 0; }
  .card-grid,
  .card-grid-2 { grid-template-columns: 1fr; }
  .hero-photo { max-width: 28rem; aspect-ratio: 4 / 5; }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #1e2023;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    gap: 0;
  }
  .nav.is-open { display: flex; }
  .nav a {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--line);
  }
  .nav a[aria-current="page"] { border-bottom-color: var(--line); }
  .site-header { position: sticky; }
  .hdr { position: relative; }
  .logo img { height: 46px; }
}

@media (min-width: 861px) and (max-width: 1024px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
}

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

@media print {
  body { background: #fff; color: #111; }
  body::before, .site-header, .site-footer, .btn { display: none !important; }
  a { color: inherit; }
}
