/* ---------- Theme ----------
   Site palette: forest green taken from the portrait.
   Work cards use each project's own brand color. */
:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --text: #18221d;
  --muted: #4a5550;
  --border: #e2e5dc;
  --accent: #2f7d4f;
  --accent-contrast: #ffffff;

  --green: #2f7d4f;

  /* Project brand colors (text-safe shade + original logo color) */
  --aircap: #0a7d8f;    --aircap-brand: #00a9ba;
  --liteflow: #00793a;  --liteflow-brand: #02b14f;
  --mesg: #491e8c;      --mesg-brand: #491e8c;

  /* Section backgrounds */
  --hero-bg: #f7f8f1;
  --glow-1: rgba(47, 125, 79, 0.22);
  --glow-2: rgba(132, 180, 40, 0.16);
  --glow-3: rgba(176, 120, 60, 0.12);
  --tint: #eef3ea;
  --contact-bg: linear-gradient(135deg, #2f7d4f 0%, #22603d 45%, #143d29 100%);
  --grad-text: linear-gradient(90deg, #2f7d4f, #174a30);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --max: 64rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  /* Horizontal padding that keeps content in a centered --max column on full-width bands */
  --pad: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1512;
    --surface: #15201b;
    --text: #eef2ec;
    --muted: #9eaaa2;
    --border: #26342d;
    --accent: #6fcf97;
    --accent-contrast: #0d1512;

    --green: #6fcf97;

    --aircap: #4fd4e2;    --aircap-brand: #00a9ba;
    --liteflow: #3ddc84;  --liteflow-brand: #02b14f;
    --mesg: #b79cf0;      --mesg-brand: #7b4fd0;

    --hero-bg: #0d1512;
    --glow-1: rgba(111, 207, 151, 0.14);
    --glow-2: rgba(181, 209, 106, 0.08);
    --glow-3: rgba(217, 160, 102, 0.08);
    --tint: #111c17;
    --contact-bg: linear-gradient(135deg, #22603d 0%, #18452e 50%, #0f2e20 100%);
    --grad-text: linear-gradient(90deg, #8ee0ae, #3fa86c);
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1em; }

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, .button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout: full-width bands, centered content ---------- */
.site-header,
main > section,
.site-footer {
  padding-inline: var(--pad);
}

main > section {
  padding-block: clamp(4rem, 10vw, 7rem);
  scroll-margin-top: 3.5rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.logo { display: block; line-height: 0; }
.logo img { display: block; height: 22px; width: auto; }
@media (max-width: 26rem) {
  .logo img { height: 20px; }
}

.site-header nav { display: flex; gap: clamp(0.75rem, 3vw, 1.75rem); }
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--accent); }

/* ---------- About / hero ---------- */
.hero {
  background:
    radial-gradient(38rem 26rem at 88% 8%, var(--glow-1), transparent 70%),
    radial-gradient(34rem 24rem at 4% 95%, var(--glow-2), transparent 70%),
    radial-gradient(28rem 20rem at 55% 55%, var(--glow-3), transparent 70%),
    var(--hero-bg);
}

.hero__intro > * { max-width: 42rem; }
.hero__intro > p:not(.lead) { color: var(--muted); }

.grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__top { display: grid; gap: 1.5rem; }
.hero__photo {
  order: -1;
  width: 7rem;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--green) 55%, transparent);
}
@media (min-width: 52rem) {
  .hero__top { grid-template-columns: 1fr 15rem; gap: 3rem; align-items: center; }
  .hero__photo { order: 0; width: 100%; border-radius: 28px; border-width: 6px; }
}

.lead { font-size: clamp(1.2rem, 2.5vw, 1.45rem); max-width: 40rem; }

/* Focus areas */
.focus {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  max-width: 48rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2rem;
}
@media (min-width: 40rem) {
  .focus { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 64rem) {
  .focus { grid-template-columns: repeat(3, 1fr); max-width: none; }
}
.focus li {
  --c: var(--green);
  display: flex;
  flex-direction: column;
  padding: 0.2rem 0 0.2rem 0.9rem;
  border-left: 3px solid var(--c);
}
.focus strong { font-size: 0.98rem; }
.focus span { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.button {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 20px -10px var(--accent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -10px var(--accent); }
.button--ghost {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--accent);
  box-shadow: none;
}
.button--ghost:hover { box-shadow: none; }

/* ---------- Work ---------- */
#work { background: var(--tint); }

.section-intro { color: var(--muted); margin-bottom: 2.5rem; }

.cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1.25rem;
}

.card {
  --c: var(--accent);
  --c-brand: var(--c);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--c-brand);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card--aircap   { --c: var(--aircap);   --c-brand: var(--aircap-brand); }
.card--liteflow { --c: var(--liteflow); --c-brand: var(--liteflow-brand); }
.card--mesg     { --c: var(--mesg);     --c-brand: var(--mesg-brand); }

.card__head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.75rem; }
.card__head h3 { margin: 0; }
.card__head .card__meta { margin-bottom: 0.15rem; }
.card__logo {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.card__logo img { width: 100%; height: 100%; display: block; }
/* Logos on a transparent background sit on a white tile */
.card__logo--light { background: #ffffff; border: 1px solid var(--border); }
.card__logo--light img { width: 70%; height: 70%; }
.card--mesg .card__logo--light img { width: 86%; height: 86%; }
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 36px -16px color-mix(in srgb, var(--c) 45%, transparent);
}
.card p { color: var(--muted); }
.card__meta { font-size: 0.85rem; margin-bottom: 0.5rem; color: var(--c) !important; font-weight: 600; }
.card__foot {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.card__link { font-weight: 600; text-decoration: none; color: var(--c); }
.card__dates { font-size: 0.85rem; color: var(--muted); }

.stats {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.stats strong { color: var(--text); font-size: 1rem; }

.tags {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tags li {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: color-mix(in srgb, var(--c) 80%, var(--text));
}

.earlier { color: var(--muted); margin: 2rem 0 0; font-size: 0.95rem; }

/* ---------- Contact ---------- */
#contact {
  background: var(--contact-bg);
  color: #ffffff;
}
#contact .section-intro { color: rgba(255, 255, 255, 0.82); }

.contact-email {
  display: inline-block;
  font-size: clamp(1.4rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #ffffff;
  word-break: break-word;
  text-decoration-color: rgba(255, 255, 255, 0.45);
}
.contact-email:hover { text-decoration-color: #ffffff; }

.contact-links {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.contact-links a { color: rgba(255, 255, 255, 0.82); }
.contact-links a:hover { color: #ffffff; }
#contact a:focus-visible { outline-color: #ffffff; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0; }
.site-footer address { font-style: normal; margin-top: 0.25rem; }
