/* Design plan
   Palette: warm paper (#FBF7F0), deep walnut ink (#2B231D), forest green accent (#2F5D4E), soft gold (#C79A3B) used sparingly.
   Type: Fraunces (headings, warm serif) + DM Sans (body).
   Layout: asymmetric hero with portrait, two-column editorial sections, alternating project rows.
   Principles: calm, generous space, one accent, content-first. */

:root {
  --bg: #FBF7F0;
  --tint: #F3ECDF;
  --ink: #2B231D;
  --muted: #6A5E52;
  --line: #E1D6C4;
  --accent: #2F5D4E;
  --accent-ink: #FFFFFF;
  --gold: #C79A3B;
  --card: #FFFDF9;
  --radius: 14px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
  --bg: #17130F;
  --tint: #1F1914;
  --ink: #F2EADD;
  --muted: #B3A592;
  --line: #3A3026;
  --accent: #7DB8A3;
  --accent-ink: #12201B;
  --gold: #D9B15A;
  --card: #1D1712;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-color: var(--line); }
.bar { display: flex; align-items: center; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.25rem; margin-right: auto; }
.brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .98rem; }
.nav a:hover { background: var(--tint); }
.nav a.active { color: var(--accent); }
.nav .nav-cta { background: var(--accent); color: var(--accent-ink); margin-left: 6px; }
.nav .nav-cta:hover { background: var(--accent); filter: brightness(1.1); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 1.05rem; cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--accent); }
.menu-btn { display: none; flex-direction: column; gap: 5px; }
.menu-btn span { width: 18px; height: 2px; background: var(--ink); display: block; transition: transform .2s; }

/* Hero */
.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.kicker { color: var(--accent); font-weight: 700; margin-bottom: 18px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 54ch; margin: 24px 0 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-meta { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .95rem; }
.hero-meta li::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-right: 9px; vertical-align: middle; }

.portrait { margin: 0; position: relative; }
.portrait img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: center 25%;
  border-radius: 200px 200px 24px 24px;
  box-shadow: 0 24px 50px -24px rgba(43,35,29,.45);
}
.portrait-frame { position: relative; }
.portrait-frame::before {
  content: ""; position: absolute; inset: 16px -14px -14px 16px; z-index: -1;
  border: 2px solid var(--gold); border-radius: 200px 200px 24px 24px; opacity: .7;
}
.portrait figcaption { margin-top: 14px; color: var(--muted); font-size: .92rem; text-align: center; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; border-radius: 999px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid transparent; transition: transform .15s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* Sections */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.tint { background: var(--tint); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head p { color: var(--muted); margin: 14px 0 0; }

.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.prose p { font-size: 1.12rem; }
.prose p:last-child { margin-bottom: 0; }

/* Projects */
.project { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; margin-bottom: clamp(40px, 6vw, 72px); }
.project:last-child { margin-bottom: 0; }
.project.flip .project-art { order: 2; }
.project-art {
  aspect-ratio: 16/10; border-radius: var(--radius); display: grid; place-items: center;
  font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -.02em;
  border: 1px solid var(--line);
}
.art-green { background: #2F5D4E; color: #F4EBD3; }
.art-clay { background: #E7D3B0; color: #4A3A22; }
.art-sand { background: #F1E7D3; color: #2F5D4E; }
:root[data-theme="dark"] .art-sand { background: #2A2219; color: #7DB8A3; }
.project-type { color: var(--accent); font-weight: 600; font-size: .88rem; margin-bottom: 8px; }
.project-body h3 { font-size: clamp(1.45rem, 2.8vw, 1.85rem); margin-bottom: 12px; }
.project-body p { color: var(--muted); }
.tags { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; font-size: .82rem; font-weight: 500; }
.tags li { padding: 4px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.link-btn { font: inherit; font-weight: 600; font-size: .95rem; color: var(--accent); cursor: pointer; background: none; border: 1.5px solid var(--accent); border-radius: 999px; padding: 8px 18px; transition: background .2s, color .2s; }
.link-btn:hover { background: var(--accent); color: var(--accent-ink); }

/* Path */
.path { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.path li { display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line); }
.path li:last-child { border-bottom: 1px solid var(--line); }
.when { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--accent); margin: 0; }
.path h3 { margin-bottom: 6px; }
.path p { color: var(--muted); margin: 0; }

/* Skills */
.skills-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(28px, 6vw, 80px); }
.skill-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 40px; }
.skill-groups h3 { font-size: 1.1rem; margin-bottom: 6px; }
.skill-groups p { margin: 0; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.contact-intro p { color: var(--muted); margin-top: 16px; }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; }
.contact-list li { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.contact-list span { color: var(--muted); }
.form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field.invalid input, .field.invalid textarea { border-color: #B3402F; }
.err { color: #B3402F; font-size: .9rem; min-height: 1.2em; display: block; margin-top: 4px; }
:root[data-theme="dark"] .err { color: #F19A8A; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 14px 0 0; font-weight: 500; }
.form-status.ok { color: var(--accent); }
.form-status.bad { color: #B3402F; }
:root[data-theme="dark"] .form-status.bad { color: #F19A8A; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .95rem; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.foot p { margin: 0; }

/* Dialog */
.dialog {
  border: 1px solid var(--line); border-radius: 18px; background: var(--card); color: var(--ink);
  width: min(560px, calc(100% - 32px)); padding: 32px; position: fixed;
}
.dialog::backdrop { background: rgba(23,19,15,.55); }
.dialog h3 { font-size: 1.8rem; margin-bottom: 12px; }
.dialog dl { margin: 20px 0 0; display: grid; gap: 14px; }
.dialog dt { color: var(--muted); font-size: .9rem; }
.dialog dd { margin: 2px 0 0; font-weight: 500; }
.dlg-close { position: absolute; top: 14px; right: 14px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 860px) {
  .hero-grid, .about-grid, .skills-grid, .contact-grid, .project { grid-template-columns: 1fr; }
  .project.flip .project-art { order: 0; }
  .portrait { max-width: 320px; order: -1; }
  .skill-groups { grid-template-columns: 1fr; }
  .path li { grid-template-columns: 1fr; gap: 6px; }
  .menu-btn { display: flex; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 18px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav .nav-cta { margin: 6px 0 0; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Project previews */
.project-art { padding: clamp(14px, 3vw, 28px); font-size: 0; }
.win { width: 100%; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 18px 36px -20px rgba(0,0,0,.45); font-size: 1rem; }
.win-bar { display: flex; gap: 6px; padding: 9px 12px; background: rgba(0,0,0,.06); }
.win-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.win-body { display: flex; min-height: 150px; padding: 12px; gap: 12px; }
.art-green .win-body, .art-clay .win-body, .art-sand .win-body { color: #2B231D; }
.m-side { width: 22%; display: grid; gap: 7px; align-content: start; }
.m-side b { height: 9px; border-radius: 5px; background: #cfe0d8; }
.m-side b:first-child { background: #2F5D4E; }
.m-main { flex: 1; display: grid; gap: 10px; align-content: start; }
.m-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: #2F5D4E; }
.m-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.m-cards u { height: 38px; border-radius: 8px; background: #E9F1ED; border: 1px solid #cfe0d8; }
.m-cards u:first-child { background: #2F5D4E; }
.m-rows { display: grid; gap: 7px; }
.m-rows s { height: 10px; border-radius: 5px; background: #ECE4D3; }
.m-rows s:nth-child(2) { width: 80%; } .m-rows s:nth-child(3) { width: 60%; }
.c-wrap { flex: 1; display: grid; gap: 8px; max-width: 230px; margin: 0 auto; }
.c-modes { display: flex; gap: 5px; font-size: .62rem; }
.c-modes b { padding: 3px 7px; border-radius: 99px; background: #F0E4CC; font-weight: 600; }
.c-modes b:first-child { background: #4A3A22; color: #fff; }
.c-screen { text-align: right; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; padding: 8px 10px; background: #F7EFDD; border-radius: 8px; }
.c-keys { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.c-keys u { height: 18px; border-radius: 6px; background: #EFE5CF; }
.c-keys u.op { background: #C79A3B; }
.p-wrap { flex: 1; display: flex; align-items: center; gap: 16px; padding: 6px 4px; }
.p-face { width: 64px; height: 64px; flex: none; border-radius: 32px 32px 8px 8px; background: url(../images/profile.jpg) center 25%/cover; }
.p-lines { flex: 1; display: grid; gap: 8px; }
.p-lines s { height: 12px; border-radius: 6px; background: #2F5D4E; width: 70%; }
.p-lines s.w { background: #ECE4D3; width: 100%; } .p-lines s.n { background: #ECE4D3; width: 55%; }
:root[data-theme="dark"] .win { color: #2B231D; }

/* Hover motion */
.project-art { transition: transform .35s ease, box-shadow .35s ease; }
.win { transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease; }
.project:hover .project-art { transform: translateY(-6px); box-shadow: 0 22px 40px -22px rgba(43,35,29,.55); }
.project:hover .win { transform: scale(1.04) rotate(-1deg); box-shadow: 0 26px 44px -18px rgba(0,0,0,.5); }
.project.flip:hover .win { transform: scale(1.04) rotate(1deg); }
.m-cards u, .m-side b, .m-rows s, .c-keys u, .c-screen, .p-face, .p-lines s { transition: transform .4s ease, background .3s ease, width .4s ease; }
.project:hover .m-cards u:nth-child(1) { transform: translateY(-4px); }
.project:hover .m-cards u:nth-child(2) { transform: translateY(-7px); }
.project:hover .m-cards u:nth-child(3) { transform: translateY(-4px); }
.project:hover .m-side b:nth-child(2) { transform: translateX(4px); }
.project:hover .m-rows s:nth-child(1) { width: 100%; }
.project:hover .m-rows s:nth-child(2) { width: 92%; }
.project:hover .c-screen { transform: scale(1.04); transform-origin: right center; }
.project:hover .c-keys u.op { background: #2F5D4E; }
.project:hover .c-keys u:nth-child(odd) { transform: translateY(-2px); }
.project:hover .p-face { transform: scale(1.1) rotate(-4deg); }
.project:hover .p-lines s { width: 100%; }
.project:hover .p-lines s.n { width: 80%; }

.portrait-frame img { transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s ease; }
.portrait-frame::before { transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.portrait:hover .portrait-frame img { transform: translateY(-8px) scale(1.02); box-shadow: 0 34px 60px -26px rgba(43,35,29,.55); }
.portrait:hover .portrait-frame::before { transform: translate(8px, 8px); opacity: 1; }

/* Dialog layout */
.dialog dl { gap: 20px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.dialog dt { font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.dialog dd { margin: 0; }
#dlgTech { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); font-size: .85rem; font-weight: 500; }

/* JARVIS previews */
.art-ink { background: #1F2A27; }
.art-ink .win { background: #18211F; color: #E8E1D2; }
.art-ink .win-bar { background: rgba(255,255,255,.07); }
.art-ink .win-bar i { background: #3A4642; }
.v-wrap { flex: 1; display: grid; gap: 10px; align-content: center; }
.v-frame { height: 58px; border-radius: 8px; background: linear-gradient(135deg,#2F5D4E,#3C7260); display: grid; place-items: center; }
.v-play { width: 0; height: 0; border-left: 14px solid #F4EBD3; border-top: 9px solid transparent; border-bottom: 9px solid transparent; transition: transform .35s ease; }
.v-tracks { display: grid; gap: 6px; }
.v-tracks s { height: 9px; border-radius: 5px; transition: width .45s ease; }
.v-tracks .a { background: #C79A3B; width: 70%; } .v-tracks .b { background: #7DB8A3; width: 48%; margin-left: 12%; } .v-tracks .c { background: #4A5A55; width: 60%; margin-left: 5%; }
.u-wrap { flex: 1; display: grid; gap: 11px; align-content: center; }
.u-row { display: grid; grid-template-columns: 18px 1fr 66px; gap: 10px; align-items: center; font-size: .72rem; }
.u-row b { width: 18px; height: 12px; border-radius: 3px; background: #C0392B; }
.u-row s { height: 8px; border-radius: 5px; background: #33403C; position: relative; overflow: hidden; }
.u-row s::after { content: ""; position: absolute; inset: 0 auto 0 0; background: #7DB8A3; border-radius: 5px; transition: width .6s ease; }
.u-row s.done::after { width: 100%; } .u-row s.mid::after { width: 55%; } .u-row s.low::after { width: 8%; }
.u-row em { font-style: normal; color: #B9B09E; }
.project:hover .v-play { transform: scale(1.3); }
.project:hover .v-tracks .a { width: 88%; } .project:hover .v-tracks .b { width: 62%; } .project:hover .v-tracks .c { width: 74%; }
.project:hover .u-row s.mid::after { width: 100%; } .project:hover .u-row s.low::after { width: 60%; }
:root[data-theme="dark"] .art-ink .win { color: #E8E1D2; }

/* CoastTrack preview */
.art-sea { background: #1F4E5A; }
.g-map { position: relative; flex: 1; min-height: 150px; border-radius: 8px; overflow: hidden; color: #2B231D;
  background: linear-gradient(#E8F0EE,#E8F0EE) padding-box;
  background-image: linear-gradient(rgba(47,93,78,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(47,93,78,.12) 1px, transparent 1px);
  background-size: 28px 28px; background-color: #EAF1EC; }
.g-route { position: absolute; left: 12%; top: 66%; width: 52%; height: 38%; border-top: 3px dashed #2F5D4E; border-right: 3px dashed #2F5D4E; border-radius: 0 28px 0 0; transition: width .5s ease; }
.g-pin { position: absolute; left: 62%; top: 30%; width: 16px; height: 16px; border-radius: 50% 50% 50% 0; background: #C0392B; transform: rotate(-45deg); transition: transform .45s ease, left .5s ease, top .5s ease; z-index: 2; }
.g-pin::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.g-pulse { position: absolute; left: calc(62% - 7px); top: calc(30% + 8px); width: 30px; height: 30px; border-radius: 50%; background: rgba(192,57,43,.2); transition: transform .5s ease; }
.g-chip { position: absolute; left: 10px; bottom: 10px; background: #fff; border-radius: 99px; padding: 3px 10px; font-size: .72rem; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.project:hover .g-pin { transform: rotate(-45deg) translate(-8px, 8px) scale(1.15); }
.project:hover .g-pulse { transform: scale(1.5); }
.project:hover .g-route { width: 56%; }

/* Contact redesign */
.section.contact { background: #1E3A31; color: #F2EADB; position: relative; overflow: hidden; }
.contact::before { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(199,154,59,.18), transparent 70%); pointer-events: none; }
.contact .contact-grid { position: relative; align-items: start; }
.contact h2 { color: #FBF6EA; }
.avail { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: .88rem; font-weight: 500; margin: 0 0 20px; color: #E9E1CF; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6FD39A; box-shadow: 0 0 0 4px rgba(111,211,154,.2); }
.contact-lead { color: #CFC8B6 !important; font-size: 1.05rem; max-width: 46ch; }
.contact .contact-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.contact .contact-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.04); transition: background .2s, border-color .2s, transform .2s; }
.contact .contact-list li:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.contact-list .ci { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(199,154,59,.16); }
.contact-list .ci svg { width: 19px; height: 19px; fill: none; stroke: #E8C77A; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.contact-list small { display: block; font-size: .74rem; color: #A9B8AF; line-height: 1.2; margin-bottom: 2px; }
.contact-list a, .contact-list .cv { color: #FBF6EA; text-decoration: none; font-weight: 500; font-size: .93rem; overflow-wrap: anywhere; line-height: 1.3; }
.contact-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.contact .contact-list li > div { min-width: 0; }
.contact .contact-list li { display: flex; grid-template-columns: none; border-top: 1px solid rgba(255,255,255,.14); }

.contact .form { background: var(--card); color: var(--ink); border: 0; border-radius: 18px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); padding: clamp(22px, 4vw, 36px); }
.form-title { font-size: 1.5rem; }
.form-sub { color: var(--muted); margin: 6px 0 22px; font-size: .95rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 65%, transparent); }
.field label { font-size: .92rem; }
.btn-block { width: 100%; padding: 15px 24px; font-size: 1.02rem; }
.form-note { margin: 12px 0 0; font-size: .82rem; color: var(--muted); text-align: center; }

/* Footer redesign */
.site-footer { padding: 48px 0 24px; border-top: 0; background: var(--bg); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; align-items: start; }
.foot-brand .brand { margin-bottom: 12px; display: inline-flex; }
.foot-brand p { color: var(--muted); max-width: 34ch; margin: 0; font-size: .95rem; }
.foot-nav, .foot-links { display: grid; gap: 8px; justify-items: start; }
.foot-nav a, .foot-links a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.foot-nav a:hover, .foot-links a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot-bottom p { margin: 0; }
@media (max-width: 860px) {
  .contact .contact-list { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
.contact-intro .avail { color: #E9E1CF; margin: 0 0 20px; }
.field .err { min-height: 0; margin-top: 2px; }
.field .err:empty { display: none; }

/* Footer v3 */
.site-footer { background: #132A22; color: #CFC8B6; border-top: 1px solid rgba(255,255,255,.08); padding: 56px 0 22px; }
.site-footer .foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 40px; }
.site-footer .brand { color: #FBF6EA; font-size: 1.15rem; margin: 0 0 14px; display: inline-flex; }
.site-footer .brand img { width: 40px; height: 40px; }
.site-footer .foot-brand p { color: #B7C2BA; max-width: 38ch; margin: 0 0 20px; font-size: .95rem; }
.foot-social { display: flex; gap: 10px; }
.foot-social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); transition: background .2s, border-color .2s, transform .2s; }
.foot-social a:hover { background: rgba(199,154,59,.2); border-color: #C79A3B; transform: translateY(-2px); }
.foot-social svg { width: 18px; height: 18px; fill: none; stroke: #E8C77A; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.foot-col { display: grid; gap: 10px; align-content: start; justify-items: start; }
.foot-col h4 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: #FBF6EA; }
.foot-col a { color: #CFC8B6; text-decoration: none; font-size: .95rem; overflow-wrap: anywhere; }
.foot-col a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-loc { color: #8FA196; font-size: .92rem; }
.site-footer .foot-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 44px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); color: #8FA196; font-size: .88rem; }
.to-top { color: #E8C77A; text-decoration: none; font-weight: 600; font-size: .9rem; }
.to-top:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 860px) {
  .site-footer .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
  .site-footer .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) { .site-footer .foot-grid { grid-template-columns: 1fr; } }

/* Copyright bar */
.site-footer .foot-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 24px; }
.foot-bottom p { margin: 0; }
.foot-bottom .made { text-align: center; color: #A9B8AF; }
.foot-bottom .made::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #C79A3B; margin-right: 10px; vertical-align: middle; }
.to-top { justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 1px solid rgba(232,199,122,.45); border-radius: 999px; color: #E8C77A; text-decoration: none; font-weight: 600; font-size: .88rem; transition: background .2s, transform .2s; }
.to-top:hover { background: rgba(232,199,122,.12); text-decoration: none; transform: translateY(-2px); }
@media (max-width: 760px) {
  .site-footer .foot-bottom { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .foot-bottom .made { text-align: center; }
  .to-top { justify-self: center; }
}

/* Copyright bar v3 */
.site-footer .foot-bottom { grid-template-columns: 1fr auto auto; gap: 12px 28px; font-size: .86rem; letter-spacing: .01em; }
.foot-bottom .made { color: #8FA196; text-align: right; }
.foot-bottom .made::before { display: none; }
.to-top { width: 38px; height: 38px; padding: 0; justify-content: center; border: 1px solid rgba(255,255,255,.22); color: #E8C77A; }
.to-top svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.to-top:hover { background: rgba(232,199,122,.14); border-color: #E8C77A; }
@media (max-width: 760px) {
  .site-footer .foot-bottom { grid-template-columns: 1fr; }
  .foot-bottom .made { text-align: center; }
}

/* Header v2 */
.site-header { background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); }
.bar { height: 72px; gap: 14px; }
.brand { gap: 12px; }
.brand img { width: 40px; height: 40px; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; }
.brand-text small { font-family: var(--sans); font-weight: 500; font-size: .76rem; color: var(--muted); }
.nav { gap: 2px; }
.nav a { position: relative; padding: 9px 13px; border-radius: 8px; font-size: .95rem; font-weight: 500; color: var(--ink); }
.nav a:not(.nav-cta):hover { background: transparent; color: var(--accent); }
.nav a:not(.nav-cta):not(.nav-resume)::after { content: ""; position: absolute; left: 13px; right: 13px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.nav a:not(.nav-cta):not(.nav-resume):hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--accent); }
.nav .nav-resume { border: 1px solid var(--line); margin-left: 8px; }
.nav .nav-resume:hover { border-color: var(--accent); }
.nav .nav-cta { margin-left: 8px; padding: 10px 20px; border-radius: 999px; font-weight: 600; background: var(--accent); color: var(--accent-ink); }
.nav .nav-cta:hover { filter: brightness(1.12); color: var(--accent-ink); }
.theme-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.menu-btn { display: none; gap: 5px; }
.menu-btn span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; display: block; transition: transform .25s, opacity .2s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 860px) {
  .menu-btn { display: flex; }
  .bar { height: 66px; }
  .nav { top: 66px; padding: 8px 16px 20px; box-shadow: 0 20px 30px -20px rgba(0,0,0,.35); }
  .nav a { padding: 14px 6px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a::after { display: none; }
  .nav .nav-resume { margin: 12px 0 0; text-align: center; border-radius: 10px; border: 1px solid var(--line); }
  .nav .nav-cta { margin: 10px 0 0; text-align: center; border-bottom: 0; }
}
@media (max-width: 380px) { .brand-text small { display: none; } }
.menu-btn { flex-direction: column; justify-content: center; align-items: center; }

/* Hero v2 */
.hero { position: relative; padding: clamp(36px, 6vw, 80px) 0 clamp(40px, 6vw, 72px); overflow: hidden;
  background: radial-gradient(900px 480px at 85% 10%, color-mix(in srgb, var(--gold) 20%, transparent), transparent 70%),
              radial-gradient(700px 420px at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(180deg, #000 0%, transparent 75%); -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%); opacity: .5; pointer-events: none; }
.hero .wrap { position: relative; }
.hero-grid { grid-template-columns: 1.2fr .8fr; }
.hero .kicker { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 24px; }
.hero .kicker .dot { background: #2FAE6B; box-shadow: 0 0 0 4px rgba(47,174,107,.2); animation: pulse 2.4s ease-in-out infinite; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.1; letter-spacing: -.025em; }
.hero h1 em { position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: .02em; height: .13em; background: color-mix(in srgb, var(--gold) 55%, transparent); border-radius: 4px; z-index: -1; }
.hero .lead { font-size: 1.15rem; max-width: 52ch; margin: 26px 0 32px; }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.hero .btn-primary { box-shadow: 0 14px 28px -14px color-mix(in srgb, var(--accent) 80%, transparent); }
.hero-tech { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tech li { padding: 5px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: .84rem; font-weight: 600; color: var(--muted); }
.portrait { max-width: 420px; justify-self: center; position: relative; }
.float-card { position: absolute; display: flex; align-items: center; gap: 10px; padding: 11px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 36px -18px rgba(43,35,29,.45); animation: bob 6s ease-in-out infinite; }
.float-card strong { display: block; font-size: .95rem; line-height: 1.2; }
.float-card small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.float-card .dot { background: #2FAE6B; box-shadow: 0 0 0 4px rgba(47,174,107,.2); flex: none; }
.fc-1 { left: -34px; bottom: 76px; }
.fc-2 { right: -26px; top: 46px; display: block; animation-delay: -3s; }
.stats { list-style: none; margin: clamp(36px, 5vw, 60px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 24px 44px -30px rgba(43,35,29,.4); }
.stats li { padding: 22px 24px; border-left: 1px solid var(--line); }
.stats li:first-child { border-left: 0; }
.stats strong { display: block; font-family: var(--serif); font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.1; color: var(--accent); }
.stats span { color: var(--muted); font-size: .9rem; line-height: 1.35; display: block; margin-top: 4px; }
.rise { opacity: 0; transform: translateY(18px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(47,174,107,.2); } 50% { box-shadow: 0 0 0 8px rgba(47,174,107,.08); } }
/* section headings get an accent bar */
.section-head h2::before, .about-grid h2::before, .skills-grid h2::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 3px; background: var(--gold); margin-bottom: 16px; }
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 300px; order: -1; }
  .fc-1 { left: -10px; bottom: 60px; } .fc-2 { right: -10px; top: 20px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li:nth-child(3) { border-left: 0; }
  .stats li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hero h1 em { white-space: normal; }
}
@media (max-width: 420px) { .fc-1 { display: none; } .stats li { padding: 16px 16px; } }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; animation: none; } .float-card, .hero .kicker .dot { animation: none; } }
.btn { gap: 8px; }
.portrait { max-width: 380px; }
@media (max-width: 860px) { .portrait { max-width: 270px; order: 0; margin-top: 8px; } .hero { padding-top: 28px; } }
