/* Design reference: change these tokens to tune the site.
   Type scale stays identical on desktop/mobile; layout alone responds.
   Colors are semantic; dark mode overrides only the palette below. */
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}
:root {
  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-body: .875rem;
  --weight-regular: 400;
  --leading-body: 1.6;
  --space: 1rem;
  --section-space: 2rem;
  --page-width: 40rem;
  --page-gutter: 2.25rem;
  color-scheme: light dark;
  --bg: #fdfdfc;
  --ink: #252925;
  --muted: #50564e;
  --accent: #38644d;
  --soft: #e9eee6;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--weight-regular) var(--text-body)/var(--leading-body) var(--font-body); -webkit-font-smoothing: antialiased; }
a { font: inherit; color: inherit; text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 4px; border-radius: 3px; transition: background-color 180ms ease, color 180ms ease; }
a:not(.app-icon):hover, a:not(.app-icon):focus-visible { background-color: var(--soft); }
.scramble-letter { display: inline-block; white-space: pre; text-align: center; pointer-events: none; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font: inherit; letter-spacing: normal; }
.page { max-width: var(--page-width); padding: 0 var(--page-gutter); margin: 0 auto; }
.socials, .project-links { display: flex; gap: var(--space); }
.intro { padding: 96px 0 var(--section-space); }
.identity { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space); margin-bottom: var(--space); }
.tech { color: var(--muted); }
.portrait { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; overflow: hidden; }
.portrait img { width: 100%; height: 100%; transform: scale(1.8); transform-origin: 45% 10%; }
.description { font-size: var(--text-body); color: var(--muted); }
.intro-footer { display: flex; justify-content: space-between; align-items: center; gap: var(--space); margin-top: var(--space); }
section[id] { padding-top: var(--section-space); }
.section-heading { margin-bottom: var(--space); }
.project { display: flex; gap: var(--space); align-items: flex-start; padding: var(--space) 0; }
.app-icon { display: block; flex-shrink: 0; width: 52px; height: 52px; }
/* macOS icons include transparent padding around the app tile. */
.app-icon-mac img { transform: scale(1.23); }
.project-details { min-width: 0; flex: 1; }
.project-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
h3 a { text-decoration: none; }
.project p, .experience-list p { color: var(--muted); }
.project-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space); margin-top: var(--space); }
.experience-list { padding: 0; margin: 0; list-style: none; }
.experience-list li { display: flex; gap: var(--space); align-items: center; padding: var(--space) 0; }
.experience-list img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.experience-list .tech { margin-left: auto; text-align: right; }
.current { color: var(--accent); background: var(--soft); padding: 3px 6px; border-radius: 4px; margin-left: 5px; }
.contact { padding: var(--section-space) 0; }
.contact p { color: var(--muted); margin: var(--space) 0; }
.email { font-size: var(--text-body); text-decoration-color: var(--accent); }
footer { display: flex; justify-content: space-between; padding: var(--section-space) 0; color: var(--muted); }
.skip { position: absolute; top: -100px; left: 16px; padding: 8px 16px; background: var(--bg); z-index: 1; }
.skip:focus { top: 16px; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --ink: #e6e8e1; --muted: #c0c5bc; --accent: #a3c7a5; --soft: #283529; }
}
@media (max-width: 600px) {
  :root { --page-gutter: 1.5rem; }
  .intro { padding-top: 64px; }
  .intro-footer { align-items: flex-start; flex-direction: column; gap: var(--space); }
  .experience-list .tech { display: none; }
}
@keyframes enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .identity, .description p, .intro-footer, .section-heading, .project,
  .experience-list li, .contact, footer {
    animation: enter 650ms cubic-bezier(.22, 1, .36, 1) both;
    animation-delay: var(--enter-delay, 0ms);
  }
  .description p:first-child { --enter-delay: 80ms; }
  .intro-footer { --enter-delay: 240ms; }
  #projects .section-heading { --enter-delay: 320ms; }
  .project:nth-of-type(1) { --enter-delay: 400ms; }
  .project:nth-of-type(2) { --enter-delay: 480ms; }
  #experience .section-heading { --enter-delay: 560ms; }
  .experience-list li { --enter-delay: 640ms; }
  .experience-list li:nth-child(2) { --enter-delay: 680ms; }
  .experience-list li:nth-child(3) { --enter-delay: 720ms; }
  .experience-list li:nth-child(4) { --enter-delay: 760ms; }
  .experience-list li:nth-child(5) { --enter-delay: 800ms; }
  .experience-list li:nth-child(6) { --enter-delay: 840ms; }
  .contact { --enter-delay: 920ms; }
  footer { --enter-delay: 1000ms; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
}
.link-icon { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.badge { color: #d92d20; background: #fde8e6; padding: 3px 6px; border-radius: 4px; margin-left: 8px; }
@media (prefers-color-scheme: dark) { .badge { color: #ff7b72; background: #3d1714; } }

/* Live AI usage — provider colors validated for the dark surface; light mode re-steps Codex and the map. */
:root { --ai-claude: #d0663a; --ai-codex: #3d433c; --ai-gemini: #4a6fd6; --ai-grok: #9aa096; --ai-opencode: #2f9e8f; --ai-panel: #f3f5f1; --ai-line: #e1e6dd; --ai-live: #2f8a4a;
  --ai-l0: #ebefe8; --ai-l1: #c9dccb; --ai-l2: #93b89a; --ai-l3: #5d8a69; --ai-l4: #38644d; }
@media (prefers-color-scheme: dark) {
  :root { --ai-codex: #ecece6; --ai-gemini: #5b84e6; --ai-grok: #55594f; --ai-opencode: #4fc1b0; --ai-panel: #1e201d; --ai-line: #262a25; --ai-live: #7ee08f;
    --ai-l0: #20241f; --ai-l1: #2a3a2c; --ai-l2: #3e5c43; --ai-l3: #62886a; --ai-l4: #a3c7a5; }
}
.ai { margin-top: var(--section-space); }
.intro:has(.ai) { padding-bottom: 8px; }
.ai-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ai-dot { position: relative; width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--muted); opacity: .5; }
.wf-sub[data-state="offline"] .ai-dot { display: none; }
.wf-sub[data-state="live"] .ai-dot { background: var(--ai-live); opacity: 1; }
.wf-sub[data-state="live"] .ai-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ai-live); animation: ai-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes ai-ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
.ai-seg { position: relative; display: grid; grid-template-columns: repeat(3, 44px); height: 28px; padding: 3px; border-radius: 9px; background: var(--ai-panel); border: 1px solid var(--ai-line); font: 600 11.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.ai-seg button { all: unset; position: relative; z-index: 1; text-align: center; line-height: 20px; color: var(--muted); cursor: pointer; border-radius: 6px; transition: color .25s; }
.ai-seg button[aria-pressed="true"] { color: var(--bg); }
.ai-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-thumb { position: absolute; top: 3px; left: 3px; width: 44px; height: 20px; border-radius: 6px; background: var(--ink); transition: transform .35s cubic-bezier(.22, 1, .36, 1); }
.ai-total { display: flex; align-items: baseline; gap: 8px; margin: 0; min-width: 0; }
.ai-odo { display: inline-flex; font-size: 22px; font-weight: 500; letter-spacing: -.025em; line-height: 1; height: 1em; font-variant-numeric: tabular-nums; }
.ai-digit { height: 1em; overflow: hidden; width: .62em; text-align: center; }
.ai-digit > span { display: flex; flex-direction: column; transition: transform 1400ms cubic-bezier(.22, 1, .36, 1); }
.ai-digit > span > span { height: 1em; }
.ai-comma { width: .28em; color: var(--muted); }
.ai-unit { font-size: 12.5px; color: var(--muted); }
.ai-share { display: flex; gap: 2px; height: 4px; margin-top: 10px; }
.ai-share i { border-radius: 3px; min-width: 3px; flex-grow: 1; transition: flex-grow .6s; }
.ai-c-claude { background: var(--ai-claude); } .ai-c-codex { background: var(--ai-codex); } .ai-c-gemini { background: var(--ai-gemini); } .ai-c-grok { background: var(--ai-grok); } .ai-c-opencode { background: var(--ai-opencode); }
.ai-providers { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ai-providers li { display: flex; gap: 6px; align-items: center; }
.ai-providers img { width: 16px; height: 16px; border-radius: 4px; }
.ai-map { display: block; width: 100%; height: auto; margin-top: 14px; }
.ai-map .l0 { fill: var(--ai-l0); } .ai-map .l1 { fill: var(--ai-l1); } .ai-map .l2 { fill: var(--ai-l2); } .ai-map .l3 { fill: var(--ai-l3); } .ai-map .l4 { fill: var(--ai-l4); }
.ai-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space); margin: 12px 0 0; }
.ai-stats div { display: flex; flex-direction: column-reverse; }
.ai-stats dd { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.ai-stats dt { color: var(--muted); font-size: 12px; }
/* My AI Workflow: a centered button with a slowly rotating ring in the provider colors. */
.wf { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; }
a.wf:hover, a.wf:focus-visible { color: var(--ink); }
.wf svg { flex-shrink: 0; }
.wf-go { display: inline-flex; flex-shrink: 0; transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
.wf-sub { display: flex; align-items: center; gap: 7px; min-width: 0; padding-left: 5px; overflow: hidden; color: var(--muted); font-size: 12.5px; }
.wf-sub span:last-child { overflow: hidden; text-overflow: ellipsis; }
.wf-place { display: flex; justify-content: center; margin-top: 24px; }
.wf-place .wf { min-width: 0; max-width: 100%; transition: transform .2s, border-color .2s, background-color .2s; }
.wf-place .wf-go svg { transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
.wf-place .wf:hover .wf-go svg { transform: translateX(3px); }
@property --wf-ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes wf-spin { to { --wf-ang: 360deg; } }
.wf-c { --wf-ring: conic-gradient(from var(--wf-ang), var(--ai-claude), var(--ai-codex), var(--ai-gemini), var(--ai-opencode), var(--ai-claude));
  position: relative; isolation: isolate; padding: 12px 18px; border-radius: 0; border: 1px solid transparent;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--wf-ring) border-box; animation: wf-spin 6s linear infinite; }
.wf-c::before { content: ""; position: absolute; inset: -4px; z-index: -1; border-radius: 0; background: var(--wf-ring); filter: blur(14px); opacity: .25; transition: opacity .25s; animation: wf-spin 6s linear infinite; }
.wf-c b { font-weight: 600; }
a.wf-c:hover, a.wf-c:focus-visible { background-color: transparent; transform: translateY(-1px); }
a.wf-c:hover::before { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .wf-c, .wf-c::before { animation: none; } }
@media (max-width: 600px) {
  .ai-head { gap: 8px; }
  .ai-seg { grid-template-columns: repeat(3, 36px); }
  .ai-thumb { width: 36px; }
  .ai-odo { font-size: 19px; }
  .ai-unit { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .wf-sub[data-state="live"] .ai-dot::after { animation: none; }
  .ai-digit > span, .ai-thumb, .ai-share i { transition: none; }
}
/* Same-site page transition: a short crossfade, then the new page's staggered entrance.
   Entrances animate only opacity and transform (no blur), so every frame stays on the compositor. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 120ms ease-out both vt-out; }
::view-transition-new(root) { animation: 180ms ease-out both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
