:root {
  --bg: #f6efe1;
  --panel: #fffdf8;
  --ink: #2b2118;
  --ink-soft: #6b5c4c;
  --line: #e3d5be;
  --coral: #e8543a;
  --coral-ink: #fffdf8;
  --teal: #1f6f6b;
  --mustard: #c9860a;
  --shadow: rgba(43, 33, 24, 0.16);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #221a12;
    --panel: #2e2418;
    --ink: #f6efe1;
    --ink-soft: #c9b79e;
    --line: #4a3b28;
    --coral: #ff6b4d;
    --coral-ink: #221a12;
    --teal: #5cc9c2;
    --mustard: #ffc15c;
    --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #221a12;
  --panel: #2e2418;
  --ink: #f6efe1;
  --ink-soft: #c9b79e;
  --line: #4a3b28;
  --coral: #ff6b4d;
  --coral-ink: #221a12;
  --teal: #5cc9c2;
  --mustard: #ffc15c;
  --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0) 0 0/22px 22px,
    var(--bg);
  color: var(--ink);
  font-family: "Karla", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.65;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: var(--coral); }
a:hover { color: var(--teal); }
img { max-width: 100%; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* handwritten accent */
.scrawl {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--coral);
  margin: 0 0 -6px;
  transform: rotate(-2deg);
  display: inline-block;
}

.scrawl-center { display: block; text-align: center; }

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

:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 20;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 16px; color: var(--bg); }

/* ---------- nav ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }

nav.wrap {
  display: flex;
  align-items: center;
  gap: 26px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.nav-mark {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}
.nav-mark:hover { color: var(--coral); }

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  position: relative;
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--coral); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  border-radius: 3px;
  background: var(--coral);
}

.theme-toggle {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.theme-toggle:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle[data-mode="light"] .icon-sun,
.theme-toggle[data-mode="dark"] .icon-moon { display: none; }
html:not(.js) .theme-toggle { display: none; }

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
  .topbar { position: static; }
  nav.wrap { flex-wrap: wrap; row-gap: 10px; justify-content: space-between; }
  .nav-links { order: 3; flex-basis: 100%; margin-left: 0; justify-content: space-between; font-size: 0.88rem; }
}

/* ---------- scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  translate: 0 22px;
  transition: opacity 0.6s ease, translate 0.6s ease;
}
.js .reveal.in { opacity: 1; translate: 0 0; }

/* ---------- hero ---------- */
header.hero { padding: 32px 0 64px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; display: flex; flex-direction: column; align-items: center; }
}

h1.hero-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1;
  margin: 0;
  text-wrap: balance;
}

.hero-tagline {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: 44ch;
  margin: 22px 0 0;
  color: var(--ink-soft);
  text-wrap: balance;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 34px;
}

.btn {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary {
  background: var(--coral);
  color: var(--coral-ink);
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn.primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }

.btn.ghost {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn.ghost:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); color: var(--teal); }

.availability {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.availability .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2fa36b;
  box-shadow: 0 0 0 0 rgba(47, 163, 107, 0.5);
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 163, 107, 0.5); }
  100% { box-shadow: 0 0 0 10px rgba(47, 163, 107, 0); }
}

/* ---------- hero photo ---------- */
.hero-photo {
  position: relative;
  display: flex;
  justify-content: center;
}

.photo-frame {
  position: relative;
  width: min(320px, 80vw);
  aspect-ratio: 1;
  border-radius: 63% 37% 54% 46% / 43% 37% 63% 57%;
  overflow: hidden;
  background: var(--teal);
  border: 3px solid var(--ink);
  transform: rotate(-3deg);
  box-shadow: 8px 8px 0 var(--shadow);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.js .photo-frame img:not([data-loaded]) { opacity: 0; position: absolute; }
.photo-frame.no-image img { display: none; }

.photo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
}

.photo-frame.no-image .photo-fallback { display: flex; }

.fallback-initial {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 7rem;
  line-height: 1;
  color: var(--coral-ink);
}

.photo-tag {
  position: absolute;
  bottom: -6px;
  right: 4px;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  background: var(--mustard);
  padding: 4px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  transform: rotate(4deg);
}

/* ---------- section shell ---------- */
section { padding: 68px 0; }
.section-tinted { background: var(--panel); }

.section-head { margin-bottom: 34px; }

.kicker {
  display: block;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--coral);
  transform: rotate(-1.5deg);
  margin-bottom: -4px;
}

h2.section-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  margin: 0;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-copy p { max-width: 62ch; color: var(--ink-soft); font-size: 1.02rem; }
.about-copy p strong { color: var(--ink); font-weight: 700; }

.spec-card {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 8px 24px;
  box-shadow: 5px 5px 0 var(--shadow);
  margin: 0;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.spec-row:last-child { border-bottom: none; }

.spec-row dt { color: var(--ink-soft); font-weight: 600; }
.spec-row dd { margin: 0; text-align: right; font-weight: 700; }

/* ---------- skills ---------- */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.skill-pill {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 11px 22px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 3px 3px 0 var(--ink);
}
.skill-pill:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }

.skill-groups {
  display: grid;
  gap: 28px;
}

.skill-label {
  font-family: "Karla", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.skill-pill.c1 { background: color-mix(in srgb, var(--coral) 18%, var(--panel)); }
.skill-pill.c2 { background: color-mix(in srgb, var(--teal) 18%, var(--panel)); }
.skill-pill.c3 { background: color-mix(in srgb, var(--mustard) 22%, var(--panel)); }

/* ---------- projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  padding-top: 10px;
}

.project-card {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 26px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 6px 6px 0 var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pc-1 { transform: rotate(-1.5deg); }
.pc-2 { transform: rotate(1.5deg); }
.pc-3 { transform: rotate(-1deg); }

.project-card:hover, .project-card:focus-visible {
  transform: rotate(0deg) translateY(-4px);
  box-shadow: 8px 8px 0 var(--shadow);
}

.pin {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--coral);
  border: 2px solid var(--ink);
}

.project-shot {
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 12px;
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 2px solid var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.shot-bar i {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
}
.shot-bar i:nth-child(1) { background: var(--coral); }
.shot-bar i:nth-child(2) { background: var(--mustard); }
.shot-bar i:nth-child(3) { background: var(--teal); }

.shot-bar span {
  margin-left: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-view {
  position: relative;
  aspect-ratio: 16 / 10;
}

.shot-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  transition: transform 0.4s ease;
}
.project-card:hover .shot-view img { transform: scale(1.03); }

.shot-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--coral-ink);
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 0 12px, transparent 12px 24px),
    var(--teal);
}
.pc-2 .shot-fallback {
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 0 12px, transparent 12px 24px),
    var(--coral);
}

.pc-3 .shot-fallback {
  color: var(--ink);
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 24px),
    var(--mustard);
}

.shot-view.no-image img { display: none; }
.shot-view.no-image .shot-fallback { display: grid; }

.project-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0;
}

.project-desc { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.project-visit {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--coral);
  transition: color 0.15s ease;
}
.project-card:hover .project-visit { color: var(--teal); }

.project-status {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--ink);
  background: var(--mustard);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  transform: rotate(-3deg);
}

.project-tags span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ---------- experience ---------- */
.experience-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 760px) {
  .experience-grid { grid-template-columns: 1fr; }
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 28px;
  border-left: 2px dashed var(--line);
  display: grid;
  gap: 30px;
}

.job { position: relative; }

.job::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--ink);
}
.job:first-child::before { background: var(--coral); }

.job-dates {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.job-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 2px 0 0;
}

.job-org { margin: 0; font-weight: 700; color: var(--teal); font-size: 0.95rem; }
.job-desc { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.96rem; max-width: 56ch; }

.honors-card {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 22px 26px;
  box-shadow: 5px 5px 0 var(--shadow);
}

.honors-card h3 {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--coral);
  margin: 0 0 6px;
}
.honors-card ul + h3 { margin-top: 18px; }

.honors-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.honors-card li {
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-weight: 600;
  font-size: 0.95rem;
}
.honors-card li:last-child { border-bottom: none; }

/* ---------- process ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.process-step {
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 24px 26px 26px;
  box-shadow: 5px 5px 0 var(--shadow);
}

.step-num {
  display: block;
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: 2.2rem;
  line-height: 1;
  color: var(--coral);
  margin-bottom: 10px;
}

.process-step h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 6px;
}

.process-step p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }

/* ---------- contact ---------- */
.contact-panel {
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: clamp(36px, 6vw, 64px);
  text-align: center;
  box-shadow: 8px 8px 0 var(--shadow);
}

.contact-panel h2 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  margin: 8px 0 14px;
  text-wrap: balance;
}

.contact-panel .accent-word { color: var(--coral); }

.contact-panel p.lede {
  color: var(--ink-soft);
  max-width: 48ch;
  margin: 0 auto 32px;
  font-size: 1.02rem;
}

.email-row {
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  margin-bottom: 22px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
}

.email-addr {
  padding: 13px 20px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 3.4vw, 1.15rem);
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.email-addr:hover { color: var(--coral); }

.copy-btn {
  flex: none;
  min-width: 92px;
  padding: 0 18px;
  border: 0;
  border-left: 2px solid var(--ink);
  background: var(--coral);
  color: var(--coral-ink);
  font: 700 0.95rem "Bricolage Grotesque", sans-serif;
  cursor: pointer;
}
.copy-btn:hover { background: var(--teal); }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.contact-links a {
  text-decoration: none;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 11px 24px;
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.contact-links a:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); color: var(--coral); }

/* ---------- back to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--coral);
  color: var(--coral-ink);
  box-shadow: 3px 3px 0 var(--ink);
  opacity: 0;
  visibility: hidden;
  translate: 0 12px;
  transition: opacity 0.25s ease, translate 0.25s ease, visibility 0.25s, transform 0.15s ease, box-shadow 0.15s ease;
}
.to-top.visible { opacity: 1; visibility: visible; translate: 0 0; }
.to-top:hover { color: var(--coral-ink); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.to-top svg { width: 22px; height: 22px; }

html:not(.js) .to-top { opacity: 1; visibility: visible; translate: 0 0; }

@media (max-width: 560px) {
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* ---------- footer ---------- */
footer {
  padding: 32px 28px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
