/* teddycarmichael.com — one stylesheet, no dependencies */
:root {
  --bg: #fbfaf7;
  --fg: #1f2327;
  --muted: #5c6670;
  --rule: #d9d4c9;
  --accent: #244f6b;
  --accent-soft: #e6eef3;
  --card: #ffffff;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --serif: "Charter", "Iowan Old Style", "Georgia", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --fg: #e7e4dc;
    --muted: #a3a9b0;
    --rule: #30363c;
    --accent: #8fb8d4;
    --accent-soft: #1d2a33;
    --card: #1a1e22;
  }
}
:root[data-theme="dark"] {
  --bg: #14171a;
  --fg: #e7e4dc;
  --muted: #a3a9b0;
  --rule: #30363c;
  --accent: #8fb8d4;
  --accent-soft: #1d2a33;
  --card: #1a1e22;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}
.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 16px 4rem;
}

/* header / nav */
header.site {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2rem;
}
header.site .wrap {
  padding-top: 1.25rem;
  padding-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}
header.site .name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-decoration: none;
}
nav.main {
  font-family: var(--sans);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}
nav.main a { color: var(--muted); text-decoration: none; padding: 0.15rem 0; border-bottom: 2px solid transparent; }
nav.main a:hover { color: var(--accent); }
nav.main a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
/* sub-tabs under Research: a small menu on hover or keyboard focus; on the Research page they are also a visible tab row */
nav.main .has-sub { position: relative; display: flex; }
nav.main .sub-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 15rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.35rem 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  z-index: 5;
}
nav.main .has-sub:hover .sub-menu, nav.main .has-sub:focus-within .sub-menu { display: block; }
nav.main .sub-menu a { display: block; padding: 0.35rem 0.9rem; border-bottom: 0; color: var(--fg); white-space: nowrap; }
nav.main .sub-menu a:hover { background: var(--accent-soft); color: var(--accent); }
nav.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}
nav.subtabs a {
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
}
nav.subtabs a:hover { border-color: var(--accent); }
body:has(#climate:target) nav.subtabs a[href="#climate"],
body:has(#convertibles:target) nav.subtabs a[href="#convertibles"] { background: var(--accent); color: #fff; }
h2[id] { scroll-margin-top: 1rem; }
.group {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.75rem 0 0.25rem;
}

/* full-bleed video hero on the home page: header, name, lede and links sit on the clip */
.hero-full {
  position: relative;
  min-height: min(76vh, 760px);
  display: flex;
  flex-direction: column;
  color: #fff;
  overflow: hidden;
  background: #1a2228;
  margin-bottom: 2.5rem;
}
.hero-full .hero-video, .hero-full .hero-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  z-index: 0;
}
.hero-full .hero-still { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-full .hero-video { display: none; }
  .hero-full .hero-still { display: block; }
}
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.45) 0, rgba(0,0,0,0) 28%),
    linear-gradient(to top, rgba(0,0,0,0.72) 0, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0) 75%);
}
.hero-full > header.site, .hero-full > .hero-text { position: relative; z-index: 2; }
header.site.on-hero { border-bottom: 0; margin-bottom: 0; }
header.site.on-hero .name { color: #fff; }
header.site.on-hero nav.main a { color: rgba(255,255,255,0.82); }
header.site.on-hero nav.main a:hover { color: #fff; }
header.site.on-hero nav.main a[aria-current="page"] { color: #fff; border-bottom-color: #fff; }
header.site.on-hero nav.main .sub-menu { background: rgba(20,28,34,0.92); border-color: rgba(255,255,255,0.25); }
header.site.on-hero nav.main .sub-menu a { color: #fff; }
header.site.on-hero nav.main .sub-menu a:hover { background: rgba(255,255,255,0.14); color: #fff; }
.hero-text {
  margin-top: auto;
  padding-top: 3rem;
  padding-bottom: 1.5rem;
  width: 100%;
}
.hero-text h1 { color: #fff; font-size: 2.4rem; text-shadow: 0 1px 12px rgba(0,0,0,0.5); margin-bottom: 0.4rem; }
.hero-text .lede { color: rgba(255,255,255,0.92); text-shadow: 0 1px 8px rgba(0,0,0,0.5); margin-bottom: 1rem; }
.hero-text .profile-links { margin-bottom: 1.25rem; }
.hero-text .profile-links a { color: #fff; background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.35); backdrop-filter: blur(4px); }
.hero-text .profile-links a:hover { background: rgba(255,255,255,0.28); text-decoration: none; }
.hero-caption { font-family: var(--sans); font-size: 0.78rem; color: rgba(255,255,255,0.72); margin: 0; }
@media (max-width: 480px) { .hero-full { min-height: 70vh; } .hero-text h1 { font-size: 2rem; } }

/* plain photograph band (other pages, or the home page without a clip) */
.hero { margin: 0 0 2rem; }
.hero img, .hero video { display: block; width: 100%; height: auto; border-radius: 6px; }
.hero figcaption, figure figcaption {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
}
figure { margin: 1.5rem 0; }
figure img { max-width: 100%; height: auto; border-radius: 6px; }
.portrait { float: right; width: 9rem; margin: 0 0 1rem 1.25rem; }
.portrait img { border-radius: 6px; }
@media (max-width: 480px) { .portrait { float: none; width: 8rem; margin: 0 0 1rem; } }

/* type */
h1, h2, h3 {
  font-family: var(--sans);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}
h1 { font-size: 1.9rem; font-weight: 650; }
h2 { font-size: 1.35rem; font-weight: 600; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
h3 { font-size: 1.1rem; font-weight: 600; margin-top: 1.75rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }
.lede { font-size: 1.2rem; color: var(--muted); margin-bottom: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
code { font-family: var(--mono); font-size: 0.9em; }

/* profile-links row, directly under the opening line */
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.85rem;
}
.profile-links li { margin: 0; }
.profile-links a {
  display: inline-block;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}
.profile-links a:hover { text-decoration: underline; }

/* stream cards on the home page */
.streams {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.1rem 1.2rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* dated updates list */
.updates {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.updates li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}
.updates li:last-child { border-bottom: 0; }
.updates time {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 0.15rem;
}
@media (max-width: 480px) {
  .updates li { grid-template-columns: 1fr; }
}

/* research entries and garden entries */
article.note, article.entry {
  border-left: 3px solid var(--accent-soft);
  padding-left: 1rem;
  margin: 1.5rem 0 2rem;
}
article.note h3, article.entry h3 { margin-top: 0; }
.meta {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin: -0.25rem 0 0.75rem;
}
.meta span + span::before { content: " · "; }
.status {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
}

/* publication entries: summary line, citation, badges */
.pub { margin: 0 0 1.75rem; }
.pub .summary { margin-bottom: 0.4rem; }
.pub .cite { font-size: 0.95rem; margin-bottom: 0.4rem; }
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.78rem;
}
.badges li { margin: 0; }
.badges a, .badges span {
  display: inline-block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.1rem 0.5rem;
  text-decoration: none;
  color: var(--accent);
}
.badges span { color: var(--muted); border-style: dashed; }
.badges a:hover { background: var(--accent-soft); }

/* the dated-record block that research pages and notes carry */
.record {
  margin-top: 2rem;
  padding: 0.9rem 1rem;
  background: var(--accent-soft);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.5;
}
.record dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 0.9rem; }
.record dt { color: var(--muted); }
.record dd { margin: 0; }
@media (max-width: 480px) { .record dl { grid-template-columns: 1fr; } .record dt { margin-top: 0.4rem; } }

/* contact list */
.contact dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1.5rem; }
.contact dt { color: var(--muted); font-family: var(--sans); font-size: 0.9rem; padding-top: 0.1rem; }
.contact dd { margin: 0; }
@media (max-width: 480px) { .contact dl { grid-template-columns: 1fr; } .contact dt { margin-top: 0.5rem; } }

/* footer */
footer.site {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}
footer.site a { color: var(--muted); }
footer.site .links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-bottom: 0.5rem; }

/* contact form */
.contact-form { margin: 1.5rem 0 2rem; max-width: 36rem; }
.contact-form .field { margin-bottom: 1rem; }
.contact-form label { display: block; font-family: var(--sans); font-size: 0.92rem; color: var(--fg); margin-bottom: 0.3rem; }
.contact-form .req { color: var(--muted); font-weight: normal; }
.contact-form .opt { color: var(--muted); font-weight: normal; }
.contact-form input:not([type=checkbox]), .contact-form select, .contact-form textarea {
  display: block; width: 100%; box-sizing: border-box; font: inherit; color: var(--fg); background: var(--card);
  border: 1px solid var(--rule); border-radius: 6px; padding: 0.55rem 0.7rem; }
.contact-form textarea { resize: vertical; min-height: 9rem; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.2rem; }
.contact-form button { font: inherit; font-family: var(--sans); font-weight: 600; color: #fff; background: var(--accent);
  border: 0; border-radius: 999px; padding: 0.6rem 1.6rem; cursor: pointer; }
.contact-form button:hover { filter: brightness(1.1); }
.contact-form button:disabled { opacity: 0.6; cursor: default; }
.contact-form .form-status { margin: 0; font-family: var(--sans); font-size: 0.92rem; color: var(--muted); }
