/* =========================================================
   Colors and fonts: change them here and the whole site follows
   ========================================================= */
:root {
  --cream: #FAF5EC;      /* background */
  --cocoa: #2B1E17;      /* text */
  --brick: #A74D4A;      /* accent: name, links */
  --blue: #1470AF;       /* surprise: stickers, ticker */
  --muted: #6B5A4E;      /* secondary text */
  --line: #E6DCCB;       /* borders */
  --tint: #F1E7D6;       /* placeholder fill */
  --card: #FFFFFF;

  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --width: 760px;        /* max width of the content column */
}

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

html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--cocoa);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(32px, 7vw, 44px); margin-bottom: 24px; font-variation-settings: "SOFT" 100, "WONK" 1; }
h3 { font-size: 22px; }
p { margin: 0 0 12px; }

a { color: var(--brick); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-style: wavy; }
a:focus-visible, .site-nav a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

main { max-width: var(--width); margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 20; }
.skip-link:focus { left: 8px; }

/* =========================================================
   Draft banner (delete with the HTML line before launch)
   ========================================================= */
.draft-banner {
  margin: 0; padding: 6px 16px; text-align: center;
  background: var(--cocoa); color: var(--cream); font-size: 13px;
}

/* =========================================================
   Menu: sticks to the top while you scroll
   ========================================================= */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.site-nav nav {
  display: flex; justify-content: center; gap: clamp(12px, 4.5vw, 20px);   /* tighter on small phones */
  max-width: var(--width); margin: 0 auto; padding: 14px 16px;
  overflow-x: auto; white-space: nowrap;
}
.site-nav a { color: var(--cocoa); text-decoration: none; font-size: 15px; font-weight: 500; }
.site-nav a:hover { color: var(--brick); text-decoration: underline wavy; text-underline-offset: 5px; }

/* =========================================================
   Home
   ========================================================= */
.hero { padding: 40px 0 32px; }

.wordmark {
  font-size: clamp(76px, 22vw, 150px);
  line-height: 1.02;   /* enough room for the "y" tail to clear the dot on the "i" below */
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brick);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.thesis {
  font-family: var(--font-head);
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.3;
  margin: 20px 0 20px;
  max-width: 30ch;
  font-variation-settings: "SOFT" 50;
}

.looking {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 15px; margin-bottom: 24px;
}
.looking a { white-space: nowrap; }
.looking-dot {
  flex: none; width: 10px; height: 10px; margin-top: 7px;
  border-radius: 50%; background: var(--blue);
}

/* Arched portrait frame (borrowed from Cedar) */
.portrait {
  margin: 0;
  aspect-ratio: 4 / 5;
  width: min(100%, 300px);
  border-radius: 999px 999px 18px 18px;
  overflow: hidden;
}
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

/* =========================================================
   Word band: edge to edge, no background block,
   slow scroll with the left and right edges fading out
   ========================================================= */
body { overflow-x: clip; }   /* lets the band reach the screen edges without sideways scrolling */

.band {
  width: 100vw;
  margin: 24px 0 0 calc(50% - 50vw);   /* break out of the content column */
  padding: 12px 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--font-head);
  font-size: clamp(26px, 6vw, 36px);
  color: var(--blue);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 18%, #000 82%, transparent);
}
.band .dot { font-style: normal; color: var(--brick); padding: 0 0.4em; }

/* Two identical copies slide left forever, so the loop has no seam */
.band-track { display: inline-flex; animation: band-scroll 45s linear infinite; }
@keyframes band-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Motion off: the band holds still */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .band-track { animation: none; }
}

/* =========================================================
   Sections
   ========================================================= */
.section { padding: 56px 0 8px; }
.subhead { font-size: 24px; margin: 32px 0 8px; }

/* =========================================================
   Project cards
   ========================================================= */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 16px 6px;
  margin-bottom: 24px;
}
.card-featured h3 { font-size: 28px; }
.card-img { aspect-ratio: 16 / 10; border-radius: 12px; margin-bottom: 14px; }
.meta { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.card h3 { margin-bottom: 4px; }
.role { font-size: 15px; color: var(--muted); }
.card-links { font-size: 15px; font-weight: 500; }

/* The Reading Light card: plain tile; the graph paper lives inside the logo's square */
.logo-tile {
  display: grid; place-items: center;
  background-color: #FFFFFF;
  border: 1px solid var(--line);
}
.rl-logo { display: block; width: 100%; height: 100%; }
.rl-logo text { font-family: "Oswald", "Arial Narrow", Impact, sans-serif; fill: #2B1E17; }
.rl-logo .rl-title { font-size: 31px; font-weight: 600; }
.rl-logo .rl-tag { font-size: 12.5px; font-weight: 500; fill: #E5482B; }
.rl-logo .rl-small { font-size: 9.5px; font-weight: 500; }
.red-letters { color: var(--brick); }
.tagline { font-family: var(--font-head); font-style: italic; font-size: 16px; color: var(--cocoa); }

/* Sticker badges (borrowed from Condesa) */
.sticker {
  position: absolute; top: -12px; right: 16px; z-index: 1;
  background: var(--blue); color: var(--cream);
  font-family: var(--font-head); font-size: 15px;
  padding: 5px 14px; border-radius: 999px;
  transform: rotate(5deg);
}

/* Signature detail: a song for every project */
.soundtrack { font-size: 14px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 12px; }
.soundtrack .note { color: var(--brick); font-size: 16px; }

.card-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; margin-top: 8px; }
@media (min-width: 700px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   Code viewer (Battleship card)
   ========================================================= */
/* When the code is showing, the card stretches across both columns */
.card.is-code-open { grid-column: 1 / -1; }

/* Video / code switch at the top of the card */
.media-switch {
  display: inline-flex; gap: 4px; margin-bottom: 10px;
  background: var(--cream); border: 1px solid var(--line); border-radius: 999px; padding: 3px;
}
.media-btn {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  color: var(--muted); background: transparent; border: 0; border-radius: 999px;
  padding: 6px 14px;
}
.media-btn[aria-pressed="true"] { background: var(--brick); color: var(--cream); }
.media-btn[aria-pressed="true"] .code-count { color: var(--cream); }
.media-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.code-count { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 2px; }

.media-slot { margin-bottom: 14px; }
.media-slot .card-img { margin-bottom: 0; }
.code-viewer[hidden], .media-slot [hidden] { display: none; }

/* Drawing of the game in a terminal (Battleship card) */
.board-tile { display: grid; place-items: center; background: var(--tint); border: 1px solid var(--line); }
.bs-art { display: block; width: 100%; height: 100%; }
.bs-art text { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; }
.bs-art .bs-line { font-size: 14px; fill: #FAF5EC; }
.bs-art .bs-row { font-size: 15px; }
.bs-art .bs-pipe { fill: rgba(250, 245, 236, 0.45); }
.bs-art .bs-x { fill: #B9A48F; }
.bs-art .bs-h { fill: #E8A9A5; font-weight: 700; }
.bs-art .bs-m { fill: #8EB6DC; font-weight: 700; }
.bs-art .bs-win { fill: #E8A9A5; font-weight: 700; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.code-notes { display: grid; gap: 8px; margin: 0 0 10px; }
.code-note {
  display: block; width: 100%; text-align: left; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--cocoa);
  background: var(--cream); border: 1px solid var(--line); border-left: 3px solid var(--blue);
  border-radius: 0; padding: 8px 12px;
}
.code-note:hover, .code-note.is-active { background: #EEF4FA; }
.code-note:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.code-note-lines { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--blue); }

.code-viewer pre[class*="language-"],
.code-viewer pre {
  position: relative;
  max-height: 60vh; overflow: auto;
  margin: 0; padding: 12px 12px 12px 3.8em;   /* left room for line numbers */
  background: #FBF7F0; border: 1px solid var(--line); border-radius: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.6;
  tab-size: 4; white-space: pre;
}
.code-viewer code { font-family: inherit; font-size: inherit; line-height: inherit; color: var(--cocoa); }
.code-download { font-size: 14px; margin-top: 8px; }

/* Line numbers and highlighted note lines (Prism plugins), in site colors */
.code-viewer .line-numbers .line-numbers-rows { border-right: 1px solid var(--line); }
.code-viewer .line-numbers-rows > span::before { color: #9C8A7C; }
.code-viewer .line-highlight {
  background: rgba(20, 112, 175, 0.08);
  box-shadow: inset 3px 0 0 var(--blue);
}
.code-viewer .line-highlight::before, .code-viewer .line-highlight::after { display: none; }

/* Syntax colors: same palette as the rest of the site */
.code-viewer .token.comment { color: var(--muted); font-style: italic; }
.code-viewer .token.triple-quoted-string { color: var(--muted); }
.code-viewer .token.string { color: var(--brick); }
.code-viewer .token.keyword, .code-viewer .token.builtin, .code-viewer .token.boolean { color: var(--blue); }
.code-viewer .token.number { color: var(--blue); }
.code-viewer .token.function { color: var(--cocoa); font-weight: 600; }
.code-viewer .token.operator, .code-viewer .token.punctuation { color: #5A4A3F; }

/* =========================================================
   Activities, honors, academics
   ========================================================= */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.activity-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 4px; }
.activity-head h3 { font-size: 20px; }
.years { font-size: 14px; color: var(--muted); }

/* An activity with a small photo, like a snapshot taped to the page */
.activity-list li.has-photo { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 16px; align-items: start; }
.activity-photo {
  display: block; width: 120px; height: 120px; object-fit: cover; object-position: 45% 30%;
  border: 5px solid var(--card); border-radius: 6px;
  box-shadow: 0 2px 8px rgba(43, 30, 23, 0.18);
  transform: rotate(2.5deg); margin-top: 4px;
}
@media (min-width: 700px) {
  .activity-list li.has-photo { grid-template-columns: minmax(0, 1fr) 150px; }
  .activity-photo { width: 150px; height: 150px; }
}
.org { font-size: 15px; color: var(--muted); }
.impact { font-size: 15px; }

.honors { padding-left: 20px; }
.honors li { margin-bottom: 6px; }

.facts { margin: 0; }
.facts div { border-top: 1px solid var(--line); padding: 12px 0; }
.facts dt { font-size: 14px; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
@media (min-width: 700px) {
  .facts div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; }
}

/* =========================================================
   Currently, contact, footer
   ========================================================= */
.currently ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.currently li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.currently .label { font-size: 14px; color: var(--muted); }

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

/* Contact form */
.contact-form { display: grid; gap: 14px; max-width: 520px; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field-hint { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 16px;   /* 16px stops phones from zooming in */
  color: var(--cocoa); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--blue); outline-offset: 1px; border-color: transparent; }
.send-btn {
  justify-self: start; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--cream);
  background: var(--brick); border: 0; border-radius: 999px; padding: 10px 26px;
}
.send-btn:hover { background: #8F3F3C; }
.send-btn:disabled { opacity: 0.7; cursor: progress; }
.send-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.form-status { margin: 0; font-weight: 500; color: var(--cocoa); }
.contact-form.is-sent .field, .contact-form.is-sent .send-btn { display: none; }
.hp[hidden] { display: none; }

/* Thank-you page (shown only if the form's script doesn't run) */
.thanks-page { padding-top: 80px; }

.site-footer {
  max-width: var(--width); margin: 56px auto 0; padding: 24px 20px 40px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted); text-align: center;
}

/* =========================================================
   Placeholders: delete these styles once every box is filled
   ========================================================= */
.ph {
  border: 2px dashed var(--brick);
  border-radius: 12px;
  background: var(--cream);
  padding: 12px 14px 4px;
  margin: 12px 0;
  font-size: 15px;
  color: var(--muted);
}
.ph-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--brick); margin-bottom: 6px;
}
.ph-img {
  display: grid; place-items: center; text-align: center;
  background: var(--tint);
  border: 2px dashed #B9A48F;
  padding: 16px; font-size: 13px; color: var(--muted);
}
.ph-img strong { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cocoa); margin-bottom: 4px; }
.ph-inline {
  background: var(--tint);
  border-bottom: 1.5px dashed #B9A48F;
  padding: 0 4px; border-radius: 3px;
  color: var(--muted);
}
.ph-link { border-bottom: 1.5px dashed var(--brick); text-decoration: none; }
