/* ==========================================================================
   Wildgreen portfolio: shared styles
   Palette: deep Atlantic navy, aqua shallows, and a little Bermuda pink sand.
   ========================================================================== */

:root {
  --bg: #08121f;
  --panel: #0e1f36;
  --panel-raised: #142a47;
  --line: #24415f;
  --text: #e8eef7;
  --muted: #a4b6cd;
  --aqua: #5cd3e6;
  --aqua-hi: #9aeaf5;
  --on-aqua: #06202b;
  --sand: #f2a9a0;

  --sans: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --radius-control: 6px;
  --radius-media: 14px;

  --gutter: 24px;
  --page-width: 1080px;
  --prose-width: 64ch;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

img,
svg,
iframe {
  max-width: 100%;
}

a {
  color: var(--aqua);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--aqua-hi);
}

:focus-visible {
  outline: 2px solid var(--aqua-hi);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  background: var(--aqua);
  color: var(--on-aqua);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-control);
  font-family: var(--sans);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type ---------- */

h1,
h2,
h3,
h4 {
  font-family: var(--sans);
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--text);
}

h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
}

p {
  margin: 0 0 1em;
  max-width: var(--prose-width);
}

.lede {
  font-size: 1.3rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 56ch;
}

.small {
  font-size: 0.9375rem;
}

.muted {
  color: var(--muted);
}

/* ---------- Site header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 18, 31, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  width: 24px;
  height: 24px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-control);
  cursor: pointer;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a.nav-link {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-control);
}

.site-nav a.nav-link:hover {
  color: var(--text);
  background: var(--panel);
}

.site-nav a.nav-link[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--aqua);
  border-radius: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--aqua);
  color: var(--on-aqua);
}

.btn-primary:hover {
  background: var(--aqua-hi);
  color: var(--on-aqua);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--aqua);
  color: var(--text);
}

.btn-network {
  border: 1px dashed var(--sand);
  color: var(--sand);
  background: transparent;
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
}

.btn-network:hover {
  color: var(--sand);
  background: rgba(242, 169, 160, 0.08);
}

.btn-network[aria-disabled="true"] {
  cursor: not-allowed;
}

.btn-network.is-live {
  border-style: solid;
  background: var(--sand);
  color: #2b1210;
}

.btn-network.is-live:hover {
  background: #f7c2bb;
  color: #2b1210;
}

.badge {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--sand);
  color: #2b1210;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-court {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.court-line {
  fill: none;
  stroke: var(--aqua);
  stroke-opacity: 0.22;
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .court-line {
    stroke-dashoffset: 1;
    animation: draw-court 2.4s ease-out 0.15s forwards;
  }
}

@keyframes draw-court {
  to {
    stroke-dashoffset: 0;
  }
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 56px;
  align-items: center;
  padding-top: 104px;
  padding-bottom: 104px;
}

.hero h1 {
  margin-bottom: 0.3em;
}

.hero-figure-wrap {
  display: block;
  line-height: 0;
}

.hero-figure {
  display: block;
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-media);
  border: 1px solid var(--line);
  background: var(--panel);
}

/* ---------- Page header (inner pages) ---------- */

.page-head {
  padding-top: 72px;
  padding-bottom: 40px;
}

.page-head h1 {
  font-size: clamp(2.3rem, 5vw, 3.5rem);
  margin-bottom: 0.35em;
}

.page-head .lede {
  margin-bottom: 0;
}

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

.section {
  padding-top: 48px;
  padding-bottom: 48px;
}

.section + .section {
  background-image: linear-gradient(var(--line), var(--line));
  background-repeat: no-repeat;
  background-position: center top;
  background-size: calc(100% - 2 * var(--gutter)) 1px;
}

.section-head {
  margin-bottom: 8px;
}

.section-head p {
  color: var(--muted);
  margin-bottom: 0;
}

/* Directory list on the home page */

.directory {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.directory li {
  border-bottom: 1px solid var(--line);
}

.directory a {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 22px 8px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.directory a:hover {
  background: var(--panel);
  color: var(--text);
}

.directory .dir-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--aqua);
}

.directory .dir-desc {
  color: var(--muted);
}

/* Network panel */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  padding: 32px;
}

.panel h2 {
  margin-bottom: 0.4em;
}

.panel p {
  color: var(--muted);
}

.panel .btn-row {
  margin-top: 4px;
}

/* ---------- Ledger entries (projects, experience, writing) ---------- */

.ledger {
  border-top: 1px solid var(--line);
}

.entry {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px 40px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

.entry-meta {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
}

.entry-meta strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}

.entry-meta p {
  margin: 0 0 0.5em;
  max-width: none;
}

.entry-meta ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry-body h3 {
  margin-bottom: 0.45em;
}

.entry-body h4 {
  margin: 1.4em 0 0.4em;
}

.entry-body ul.bullets {
  margin: 0 0 1em;
  padding-left: 1.2em;
  max-width: var(--prose-width);
}

.entry-body ul.bullets li {
  margin-bottom: 0.4em;
}

.entry-body ul.bullets li::marker {
  color: var(--aqua);
}

.media {
  display: block;
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-media);
  border: 1px solid var(--line);
  margin: 12px 0 20px;
}

.media-small {
  max-width: 260px;
}

.video {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 16 / 9;
  margin: 12px 0 20px;
  border-radius: var(--radius-media);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.topic-list {
  list-style: none;
  margin: 0 0 1em;
  padding: 0;
  column-width: 20rem;
  column-gap: 32px;
  max-width: 760px;
}

.topic-list li {
  break-inside: avoid;
  padding: 0.3em 0;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}

/* Timeline (experience) */

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 28px;
  list-style: none;
  border-left: 2px solid var(--line);
}

.timeline > li {
  position: relative;
  padding: 0 0 44px;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 0.55em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--aqua);
}

.timeline h3 {
  margin-bottom: 0.15em;
}

.timeline .when {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.8em;
}

/* Skills rows */

.skill-rows {
  margin: 0;
  border-top: 1px solid var(--line);
}

.skill-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px 40px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.skill-row dt {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--aqua);
}

.skill-row dd {
  margin: 0;
}

/* Contact list */

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.contact-list li {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.contact-list .label {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--muted);
}

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

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 40px;
  padding-top: 44px;
  padding-bottom: 36px;
}

.footer-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 0.3em;
}

.footer-grid p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  font-family: var(--sans);
  font-size: 0.95rem;
}

.footer-links li {
  margin-bottom: 0.4em;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--aqua);
}

.social {
  display: flex;
  gap: 16px;
  font-size: 1.4rem;
}

.social a {
  color: var(--muted);
}

.social a:hover {
  color: var(--aqua);
}

.footer-small {
  border-top: 1px solid var(--line);
  padding: 16px 0 24px;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-small .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

.footer-small a {
  color: var(--muted);
}

/* ---------- 404 ---------- */

.not-found {
  padding-top: 120px;
  padding-bottom: 80px;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-header .wrap {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 2px;
    padding-bottom: 8px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a.nav-link[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--aqua);
  }

  .site-nav .btn-network {
    justify-content: center;
    margin-top: 6px;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 56px;
    padding-bottom: 64px;
  }

  .hero-figure-wrap {
    order: -1;
  }

  .hero-figure {
    width: 132px;
    height: 132px;
  }

  .directory a,
  .contact-list li,
  .skill-row,
  .entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .entry {
    padding: 28px 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .panel {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .directory a {
    transition: none;
  }
}
