:root {
  --bg: #f0ead6;
  --card: #f8f4e8;
  --surface: #ebe4ce;
  --text: #474d49;
  --muted: #646a66;
  --border: rgba(40, 30, 10, 0.12);
  --border-strong: rgba(40, 30, 10, 0.32);
  --accent: #3d5270;
  --accent-soft: rgba(61, 82, 112, 0.1);
  --placeholder: #e8e1cb;
  --dot: rgba(60, 45, 20, 0.22);
  --shadow: rgba(60, 45, 20, 0.16);
  --gt-hover-text: #474d49;

  --serif: "Faustina", Georgia, serif;
  --sans: "Google Sans", system-ui, -apple-system, sans-serif;

  --width: 760px;
  --radius: 14px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

svg.icon-fill {
  fill: currentColor;
  stroke: none;
}

/* ── Top bar ─────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  max-width: var(--width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.topbar-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-nav a:hover {
  color: var(--text);
}

/* ── Layout ──────────────────────────────────── */
.page {
  max-width: var(--width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}

.page > section + section {
  margin-top: 4rem;
}

.page > section {
  scroll-margin-top: 1.5rem;
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-size: 1.75rem;
}

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

.section-head a,
.intro p a {
  color: var(--accent);
  text-decoration: none;
}

.section-head a:hover {
  text-decoration: underline;
}

.section-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ── Intro ───────────────────────────────────── */
.intro .hello {
  margin: 0;
  font-size: 1.1rem;
}

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 1.8s ease-in-out 0.5s 1;
}

.intro .hello:hover .wave {
  animation: wave 1.8s ease-in-out infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

.intro h1 {
  font-size: clamp(3rem, 9vw, 5.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  opacity: 0.8;
  margin: 0.1em 0 1.1rem;
}

.intro p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 62ch;
}

/* Georgia Tech Buzz Gold */
.intro p a.gt {
  color: #eaaa00;
  font-weight: 600;
  text-decoration: none;
  padding: 0 0.1em;
}

.intro p a.gt:hover {
  color: var(--gt-hover-text);
  background: #eaaa00;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.pill:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.pill-icon {
  padding: 0.45rem;
  font-size: 0.95rem;
}

.pill-accent {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-accent:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ── Now ─────────────────────────────────────── */
.now {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.now-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.now-head h2 {
  font-size: 1.25rem;
}

.now-date {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.now ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.now li + li {
  margin-top: 0.25rem;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

/* ── Experience ──────────────────────────────── */
.logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  padding: 0 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.2s ease;
}

.logo:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.logo img {
  height: 1.6rem;
  width: auto;
  filter: grayscale(1);
  opacity: 0.8;
  transition: filter 0.2s, opacity 0.2s;
}

.logo:hover img {
  filter: none;
  opacity: 1;
}

.logo-text {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ── Projects ────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px -12px var(--shadow);
}

.card-img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.card-img.is-diagram {
  object-fit: contain;
  background: var(--placeholder);
}

.card-img.is-empty {
  background: var(--placeholder);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.15rem 1.35rem 1.35rem;
}

.card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.card p {
  flex: 1;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card p:has(+ .stats) {
  flex: none;
}

.stats {
  flex: 1;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.stats li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.stats b {
  color: var(--text);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
}

.tag + .tag::before {
  content: "·";
  margin-right: 0.35rem;
  color: var(--muted);
}

.tag .live-dot {
  width: 6px;
  height: 6px;
}


.tag-blue,
.tag-green,
.tag-violet,
.tag-amber,
.tag-rose,
.tag-slate {
  background: transparent;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.link {
  padding: 0.2rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.8;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.link:hover {
  border-color: var(--border-strong);
}

.link-primary {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
}

.link-primary:hover {
  border-color: transparent;
  background: var(--accent);
  color: var(--card);
}

/* ── Writing ─────────────────────────────────── */
.posts {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

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

.post {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0.25rem;
  text-decoration: none;
  transition: padding-left 0.2s ease;
}

.post:hover {
  padding-left: 0.6rem;
}

.post h3 {
  font-size: 1.15rem;
  transition: color 0.15s;
}

.post:hover h3 {
  color: var(--accent);
}

.post p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.post time {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* ── Footer ──────────────────────────────────── */
.footer {
  max-width: var(--width);
  margin: 5rem auto 0;
  padding: 2rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer p {
  margin: 0;
}

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

.footer a:hover {
  text-decoration: underline;
}

.footer-small {
  margin-top: 0.35rem !important;
  font-size: 0.8rem;
}

.card-title {
  text-decoration: none;
  transition: color 0.15s;
}

.card-title:hover {
  color: var(--accent);
}

/* ── Project write-up pages ──────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 1.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s;
}

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

.article-header h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0.35rem 0 1rem;
}

.lede {
  margin: 0 0 2rem;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

.article section {
  margin-top: 2.75rem;
}

.article h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.article section > p,
.article section > ul {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.article section > p {
  margin: 0 0 1rem;
}

.article section > ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.article section > ul li + li {
  margin-top: 0.35rem;
}

.figure {
  margin: 1.5rem 0;
}

.media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--placeholder);
}

.media.is-diagram {
  object-fit: contain;
  background: var(--card);
}

.media.is-empty {
  background: var(--placeholder);
}

.figure figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.figure-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.figure-row .figure {
  margin: 0;
}

.figure-row .media {
  aspect-ratio: 4 / 3;
}

.article .results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.result-value {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.result-label {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills li {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}

.spec-table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.spec-table th,
.spec-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.spec-table tr:first-child th,
.spec-table tr:first-child td {
  border-top: 1px solid var(--border);
}

.spec-table th {
  width: 7rem;
  color: var(--muted);
  font-weight: 600;
}

.spec-table td {
  color: var(--text);
}

.next-project {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 3.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.next-project span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-project a {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s;
}

.next-project a:hover {
  color: var(--accent);
}

/* ── Small screens ───────────────────────────── */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .post {
    flex-direction: column;
    gap: 0.25rem;
  }

  .post time {
    order: -1;
    font-size: 0.8rem;
  }

  .article .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figure-row {
    grid-template-columns: 1fr;
  }
}

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

/* ── Build-log write-up ──────────────────────── */
.figure figcaption {
  font-style: italic;
}

.media.is-light {
  background: #fff;
  object-fit: contain;
}

.media.is-contain {
  object-fit: contain;
}

video.media {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #141210;
  height: auto;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: -0.5rem 0 1.5rem;
}

.gallery .figure {
  margin: 0;
}

.gallery .media {
  aspect-ratio: 1 / 1;
}

.figure-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.figure-row.three .media {
  aspect-ratio: 4 / 3;
}

.phases {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.phases li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.phases li + li {
  border-top: 1px solid var(--border);
}

.phases li b {
  color: var(--text);
  font-weight: 600;
}

.phases li.done {
  color: var(--text);
}

.phase-check {
  flex: none;
  position: relative;
  top: 0.15em;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
}

.phases li.done .phase-check {
  border-color: var(--text);
  background: transparent;
}

.phases li.done .phase-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 4px;
  height: 8px;
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.phase-when {
  margin-left: auto;
  padding-left: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.log-intro {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.log-entry {
  position: relative;
  margin-top: 2.25rem;
  padding: 0 0 0.5rem 1.5rem;
  border-left: 2px solid var(--border);
}

.log-entry::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.log-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.log-day {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.phase-tag {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.log-entry h3 {
  margin: 0.4rem 0 0.9rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}

.log-entry h4 {
  margin: 2rem 0 0.6rem;
  font-size: 1.05rem;
  color: var(--text);
}

.log-entry > p,
.log-entry > ul,
.log-entry > ol,
.faq p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.log-entry > p {
  margin: 0 0 1rem;
}

.log-entry > ul,
.log-entry > ol {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.log-entry li + li {
  margin-top: 0.4rem;
}

.log-entry b,
.article section > ul b {
  color: var(--text);
}

.table-wrap {
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  color: var(--text);
}

.data-table tbody tr + tr td {
  border-top: 1px solid var(--border);
}

.data-table tr.highlight td {
  background: var(--accent-soft);
}

.callout {
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.callout-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq details:first-of-type {
  border-top: 1px solid var(--border);
}

.faq summary {
  padding: 0.85rem 0;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.25rem;
  color: var(--accent);
  transition: transform 0.2s;
}

.faq details[open] summary::before {
  transform: rotate(45deg);
}

.faq details p {
  margin: 0 0 1rem 1.25rem;
}

@media (max-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .figure-row.three {
    grid-template-columns: 1fr;
  }

  .log-entry {
    padding-left: 1.1rem;
  }

  .phase-when {
    display: none;
  }
}
