/* Rural Smart Digital Twin — static site styles */

:root {
  --brown: #492f24;
  --brown-2: #6b4a3a;
  --gold: #ffc425;
  --gold-soft: #fff1c7;
  --cream: #fbf7ef;
  --paper: #ffffff;
  --ink: #2a211c;
  --muted: #6d625a;
  --line: #e6ddd0;
  --twin: #1f9aa8;
  --twin-soft: #e3f4f6;
  --ok: #2f7d4f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 33, 28, .06), 0 8px 24px rgba(42, 33, 28, .07);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1080px;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--brown); text-underline-offset: 3px; }
a:hover { color: var(--brown-2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--gold); color: var(--brown); padding: 8px 12px; z-index: 100;
}
.skip:focus { left: 8px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--brown); color: #fff;
  border-bottom: 3px solid var(--gold);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 16px; height: 60px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em;
  white-space: nowrap;
}
.brand:hover { color: var(--gold); }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav {
  margin-left: auto; display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #f3e9dc; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (max-width: 860px) { .nav { display: none; } }

/* ---------- Hero ---------- */
.hero { background: var(--brown); color: #fff; padding: 48px 0 0; overflow: hidden; }
.hero .kicker {
  font-family: var(--serif); font-style: italic; color: var(--gold);
  font-size: 18px; margin: 0 0 12px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(32px, 5.2vw, 56px); line-height: 1.1; margin: 0 0 18px;
  max-width: 20ch; text-wrap: balance;
}
.hero .lead {
  font-size: clamp(18px, 2.2vw, 21px); color: #f3e9dc; max-width: 60ch; margin: 0 0 14px;
}
.hero .meta { font-size: 14px; color: #cdbfb1; letter-spacing: .02em; margin: 0 0 32px; }
.hero .meta span { color: var(--gold); padding: 0 6px; }
.hero-figure {
  margin: 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
  box-shadow: 0 -2px 30px rgba(0, 0, 0, .25);
}

/* ---------- Sections ---------- */
main section { padding: 64px 0; border-bottom: 1px solid var(--line); }
main section:nth-of-type(even) { background: var(--paper); }
main section:last-of-type { border-bottom: 0; }

.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.section-num {
  flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gold); color: var(--brown); font-weight: 800; font-size: 18px;
  transform: translateY(-4px);
}
h2 {
  font-family: var(--serif); font-size: clamp(26px, 3.4vw, 36px); line-height: 1.2;
  margin: 0; color: var(--brown); text-wrap: balance;
}
h3 { font-size: 19px; margin: 0 0 8px; color: var(--brown); }
p { margin: 0 0 16px; }
.prose { max-width: 68ch; }
.questions {
  font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--brown-2);
  border-left: 4px solid var(--gold); padding: 4px 0 4px 18px; margin: 20px 0;
}
.questions ul { margin: 0; padding: 0; list-style: none; }
.questions li { margin: 6px 0; }
.callout {
  font-size: 20px; font-weight: 700; color: var(--brown);
  background: var(--gold-soft); border-radius: var(--radius); padding: 16px 20px; margin: 24px 0 0;
}

.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; gap: 48px; }
  .split.reverse > :first-child { order: 2; }
}

/* ---------- Figures & image slots ---------- */
figure { margin: 0; }
.fig {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.fig figcaption { font-size: 14px; color: var(--muted); padding: 10px 16px 12px; border-top: 1px solid var(--line); }
.fig.wide { margin: 32px 0; }

/* An image slot shows a placeholder until a real file exists at the img src. */
.slot { position: relative; aspect-ratio: 16 / 9; background: #efe7da; }
.slot.tall { aspect-ratio: 4 / 3; }
.slot.pano { aspect-ratio: 21 / 9; }
.slot .ph {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 8px;
  text-align: center; padding: 24px; color: var(--muted); font-size: 14px;
  background:
    repeating-linear-gradient(45deg, rgba(73, 47, 36, .04) 0 12px, transparent 12px 24px),
    #efe7da;
}
.slot .ph strong { color: var(--brown); letter-spacing: .08em; font-size: 12px; text-transform: uppercase; }
.slot .ph code { font-size: 12px; color: var(--brown-2); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Location chips ---------- */
.places { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 0; padding: 0; list-style: none; }
.places li {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brown); color: #fff; font-weight: 700;
  padding: 10px 18px 10px 14px; border-radius: 999px;
}
.places svg { width: 18px; height: 18px; color: var(--gold); }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 20px; margin-top: 24px; }
@media (min-width: 860px) { .cards.two { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card .icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--brown); margin-bottom: 14px;
}
.card .icon svg { width: 24px; height: 24px; }
.card p:last-child { margin-bottom: 0; }

/* ---------- Privacy checklist ---------- */
.checklist {
  background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--ok);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.checklist h3 { display: flex; align-items: center; gap: 10px; }
.checklist h3 svg { width: 24px; height: 24px; color: var(--ok); flex: none; }
.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 12px 0 12px 34px; border-top: 1px solid var(--line); }
.checklist li:first-child { border-top: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: 18px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}

/* ---------- Team ---------- */
.team { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 28px 0; }
.person {
  display: flex; gap: 16px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.avatar {
  position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
  background: var(--brown); color: var(--gold); display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 26px;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person h3 { margin: 0 0 2px; font-size: 17px; }
.person p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.fineprint { font-size: 15px; color: var(--muted); max-width: 72ch; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 52px 18px 20px; position: relative;
  font-weight: 700; color: var(--brown);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft);
  display: grid; place-items: center; font-weight: 700; line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details > p { padding: 0 20px 18px; margin: 0; }

/* ---------- Contact ---------- */
.contact {
  background: var(--brown); color: #fff; border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); max-width: 820px;
}
.contact h3 { color: var(--gold); font-size: 20px; }
.contact a { color: #fff; font-weight: 700; }
.contact a:hover { color: var(--gold); }
.contact .irb { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .2); font-style: italic; color: #e6d9cb; }

/* ---------- Footer ---------- */
.site-footer { background: #2f1e17; color: #cdbfb1; font-size: 14px; padding: 28px 0; text-align: center; }
.site-footer span { color: var(--gold); padding: 0 6px; }

/* ---------- Digital-twin animation (section 1) ---------- */
.twin-anim .car { animation: drive-x 9s linear infinite; }
.twin-anim .car.c2 { animation-duration: 12s; animation-delay: -5s; }
.twin-anim .car.c3 { animation-name: drive-x-rev; animation-duration: 10s; animation-delay: -2s; }
.twin-anim .car.c4 { animation-name: drive-y; animation-duration: 8s; animation-delay: -3s; }
.twin-anim .walker { animation: walk 14s linear infinite; }
.twin-anim .spot { animation: occupancy 6s steps(1) infinite; }
.twin-anim .spot:nth-child(3n) { animation-delay: -2s; }
.twin-anim .spot:nth-child(4n+1) { animation-delay: -4s; animation-duration: 9s; }
.twin-anim .pulse { animation: pulse 2.4s ease-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes drive-x { from { transform: translateX(-80px); } to { transform: translateX(760px); } }
@keyframes drive-x-rev { from { transform: translateX(760px); } to { transform: translateX(-80px); } }
@keyframes drive-y { from { transform: translateY(-60px); } to { transform: translateY(420px); } }
@keyframes walk { from { transform: translateX(0); } to { transform: translateX(600px); } }
@keyframes occupancy { 0% { fill: #3fbf7f; } 50% { fill: #e0634f; } }
@keyframes pulse { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }

/* Wide diagrams scroll sideways on phones instead of shrinking their labels. */
.scroller { overflow-x: auto; }
@media (max-width: 720px) { .scroller svg { min-width: 720px; } }

/* Team member names link to their UW profile pages. */
.person h3 a { color: inherit; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.person h3 a:hover { color: var(--brown-2); text-decoration-color: var(--brown-2); }
