/* Portfolio layout. CV retains its own shared stylesheet. */
:root {
  color-scheme: light;
  --bg: #f5f0e8; --panel: #eee6da; --text: #30271f; --muted: #716457;
  --accent: #946644; --accent-strong: #704b30; --line: #d8cabb; --photo-bg: #d4b998;
  --nav-bg: rgba(245,240,232,.94); --terminal-bg: #25231f; --terminal-text: #e9e4dc;
}
body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191713; --panel: #24201b; --text: #f1e9db; --muted: #b9ad9e;
  --accent: #d3ab82; --accent-strong: #e7c5a2; --line: #42382e; --photo-bg: #8c6b4c;
  --nav-bg: rgba(25,23,19,.94); --terminal-bg: #111310; --terminal-text: #e9e4dc;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 105px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Manrope", sans-serif; -webkit-font-smoothing: antialiased; transition: background .2s, color .2s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
svg { display: block; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.noise { position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .06; background-image: radial-gradient(var(--muted) .5px,transparent .5px); background-size: 7px 7px; }
.site-shell { width: min(1180px, calc(100% - 80px)); margin: 0 auto; }
.navbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 36px; min-height: 92px; border-bottom: 1px solid var(--line); background: var(--nav-bg); backdrop-filter: blur(18px); }
.brand { font-size: 34px; font-weight: 800; letter-spacing: -3px; margin-right: auto; line-height: 1; padding-right: 5px; }
.brand span { color: var(--accent); }
.nav-links, .nav-actions, .lang-switch { display: flex; align-items: center; }
.nav-links { gap: 25px; font-size: .8rem; font-weight: 600; }
.nav-links a { position: relative; padding-block: 10px; color: var(--muted); }
.nav-links a::after { position: absolute; bottom: 2px; left: 0; width: 0; height: 1px; background: var(--accent); content: ""; transition: width .2s; }
.nav-links a:hover, .nav-links a.is-current { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-current::after { width: 100%; }
.nav-actions { gap: 12px; }
.theme-toggle, .icon-link { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); }
.theme-toggle:hover, .icon-link:hover { color: var(--text); border-color: var(--accent); }
.theme-icon, .icon-link svg { width: 16px; height: 16px; }
.theme-icon-moon, body[data-theme="dark"] .theme-icon-sun { display: none; }
body[data-theme="dark"] .theme-icon-moon { display: block; }
.lang-switch { gap: 3px; }
.lang-btn { border: 0; padding: 9px 7px; background: none; font-family: "JetBrains Mono",monospace; font-size: .72rem; color: var(--muted); }
.lang-btn.is-active { color: var(--text); text-decoration: underline; text-underline-offset: 5px; }
.menu-toggle { display: none; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 70px; padding: 90px 0 75px; }
.hero-copy { min-width: 0; }
.hero-kicker, .section-index, .section-label, .hero-footnote, .portrait-caption-name, .portrait-location, .project-topline { font-family: "JetBrains Mono", monospace; font-size: .7rem; letter-spacing: .075em; }
.hero-kicker { display: flex; gap: 12px; align-items: center; color: var(--accent); margin: 0 0 28px; }
.kicker-line { width: 30px; height: 1px; background: currentColor; }
.hero-title { font-size: clamp(4.8rem, 8vw, 7.2rem); line-height: .98; letter-spacing: -.07em; margin: 0 0 30px; font-weight: 600; }
.hero-title em { display: block; font-family: Georgia, serif; font-weight: 400; color: var(--accent); letter-spacing: -.055em; }
.hero-text { color: var(--muted); font-size: 1rem; line-height: 1.85; max-width: 45ch; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.text-link { display: inline-flex; justify-content: center; align-items: center; gap: 28px; min-height: 49px; padding: 0 22px; border: 1px solid var(--line); border-radius: 5px; font-size: .82rem; font-weight: 700; transition: background .2s, transform .2s; }
.primary-link { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.primary-link:hover { background: var(--accent-strong); transform: translateY(-2px); }
.secondary-link:hover { background: var(--panel); transform: translateY(-2px); }
.hero-footnote { margin: 25px 0 0; color: var(--muted); font-size: .62rem; letter-spacing: .025em; }
.hero-side { display: flex; justify-content: center; min-width: 0; }
.hero-portrait { position: relative; width: 300px; margin: 0; isolation: isolate; }
.hero-portrait::before { position: absolute; z-index: -2; inset: -40px -20px 35px; content: ""; background: radial-gradient(ellipse, color-mix(in srgb,var(--accent) 20%,transparent),transparent 68%); pointer-events: none; }
.portrait-outline { position: absolute; inset: 0 0 12px 14px; border: 1px solid var(--line); border-radius: 160px 160px 12px 12px; z-index: -1; pointer-events: none; }
.portrait-photo { width: 100%; aspect-ratio: 15 / 17; border-radius: 155px 155px 10px 10px; overflow: hidden; background: var(--photo-bg); }
.portrait-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(.6); }
.hero-portrait figcaption { display: flex; flex-direction: column; gap: 18px; padding: 20px 0 0; }
.portrait-caption-name { color: var(--text); font-size: .7rem; }
.portrait-location { color: var(--muted); font-size: .64rem; }
.portrait-availability { display: flex; align-items: flex-start; gap: 10px; padding: 0; font-size: .7rem; font-weight: 600; line-height: 1.7; }
.status-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: #299d70; box-shadow: 0 0 0 4px #299d7018; }
.stack-strip { display: flex; align-items: center; gap: 35px; padding: 27px 0; border-block: 1px solid var(--line); }
.section-label { color: var(--muted); }
.stack-strip ul { display: flex; flex: 1; justify-content: space-between; gap: 22px; list-style: none; padding: 0; margin: 0; font-size: .88rem; font-weight: 600; }
.stack-arrow { font-size: 22px; color: var(--accent); }
.content-block { margin-top: 100px; }
.section-index { color: var(--accent); margin: 0 0 20px; text-transform: uppercase; font-size: .66rem; letter-spacing: .12em; }
.section-heading { margin-bottom: 34px; }
.section-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
h2 { letter-spacing: -.04em; font-weight: 600; }
.section-heading h2 { font-size: clamp(2rem,3.4vw,3rem); margin: 0; line-height: 1.12; }
.section-title-row > p { color: var(--muted); max-width: 36ch; font-size: .85rem; line-height: 1.8; margin: 0; }
.project-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 40px 28px; }
.project-card { min-width: 0; }
.project-image-wrap { overflow: hidden; aspect-ratio: 16 / 10; border-radius: 10px; background: var(--panel); padding: 22px; border: 1px solid var(--line); }
.project-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 4px; transition: transform .5s; }
.project-card:hover .project-image { transform: scale(1.025); }
.project-body { padding: 23px 0 0; }
.project-topline { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: .6rem; text-transform: uppercase; line-height: 1.7; }
.project-number { color: var(--accent); font-size: .65rem; }
.project-headline-row h3 { font-size: 1.45rem; font-weight: 600; letter-spacing: -.035em; margin: 12px 0; }
.project-body > p { color: var(--muted); font-size: .87rem; line-height: 1.85; margin: 0 0 18px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row span { font-family: "JetBrains Mono",monospace; color: var(--muted); font-size: .65rem; padding: 5px 8px; border: 1px solid var(--line); border-radius: 3px; }
.project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; margin-top: 24px; }
.project-cta { font-size: .75rem; font-weight: 700; color: var(--text); padding: 8px 0; border-bottom: 1px solid var(--line); transition: border-color .2s,color .2s; }
a.project-cta:hover { color: var(--accent); border-color: var(--accent); }
.project-demo-unavailable { color: var(--muted); font-size: .68rem; font-weight: 400; border: 0; }
.featured-card { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 42px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.featured-card .project-image-wrap { padding: 0; border-radius: 6px; aspect-ratio: 2 / 1; background: var(--bg); }
.featured-card .project-image { object-fit: contain; }
.featured-card .project-body { padding: 0 6px 0 0; }
.featured-card .project-headline-row h3 { font-size: 2.5rem; margin: 18px 0; }
.featured-card .project-actions { margin-top: 22px; }
#experience { display: grid; grid-template-columns: .85fr 1.4fr; gap: 90px; padding-top: 60px; border-top: 1px solid var(--line); }
.section-intro { margin: 24px 0; font-size: .88rem; line-height: 1.9; color: var(--muted); }
.inline-link { display: inline-flex; gap: 25px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: .8rem; }
.inline-link:hover { color: var(--accent); }
.timeline { min-width: 0; }
.timeline-item { position: relative; padding: 0 0 34px 28px; border-left: 1px solid var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { position: absolute; left: -4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); content: ""; }
.timeline-head { display: flex; justify-content: space-between; gap: 18px; }
.timeline-type { font-family: "JetBrains Mono",monospace; font-size: .65rem; color: var(--accent); margin: 0 0 11px; }
.timeline-head h3 { font-size: 1.12rem; letter-spacing: -.025em; margin: 0 0 8px; }
.timeline-company { font-size: .8rem; color: var(--muted); }
.timeline-meta { display: grid; align-content: start; gap: 8px; text-align: right; font-size: .65rem; color: var(--muted); line-height: 1.6; }
.timeline-list { font-size: .8rem; line-height: 1.9; color: var(--muted); padding-left: 16px; margin: 18px 0; }
.timeline-list li::marker { color: var(--accent); }
.activity-section { display: grid; grid-template-columns: .85fr 1.4fr; gap: 90px; margin-top: 90px; align-items: center; }
.activity-caption h2 { font-size: 2rem; line-height: 1.2; margin: 0 0 20px; }
.activity-caption > p:last-child { color: var(--muted); font-size: .85rem; line-height: 1.85; }
.commits-block { margin: 0; background: var(--terminal-bg); color: var(--terminal-text); border: 1px solid var(--line); border-radius: 8px; min-width: 0; overflow: hidden; font-family: "JetBrains Mono",monospace; }
.commits-block .block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid #ffffff16; }
.commits-block h2 { font-size: .72rem; margin: 0; letter-spacing: 0; font-weight: 500; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; color: #84c5a5; font-size: .6rem; }
.live-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.github-summary { color: #a8b0a5; font-size: .61rem; line-height: 1.7; padding: 15px 20px 0; }
.commit-list { padding: 8px 20px 0; }
.commit-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid #ffffff0d; }
.commit-main { display: grid; min-width: 0; gap: 5px; }
.commit-repo { font-size: .68rem; font-weight: 700; overflow-wrap: anywhere; }
.commit-separator { display: none; }
.commit-message { color: #a8b0a5; font-size: .63rem; line-height: 1.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-stats, .commit-date { display: flex; flex: 0 0 auto; gap: 6px; font-size: .6rem; color: #a8b0a5; }
.commit-additions { color: #84c5a5; }
.commit-deletions { color: #e89989; }
.commit-line:hover .commit-repo { color: #84c5a5; }
.github-footer-link { display: inline-block; padding: 17px 20px; font-size: .6rem; color: #a8b0a5; }
.github-footer-link:hover { color: white; }
#contact { position: relative; margin-top: 110px; padding: 55px 0 0; border-top: 1px solid var(--line); }
.contact-layout { display: grid; grid-template-columns: .95fr 1.05fr; gap: 70px; align-items: center; padding-bottom: 45px; }
#contact h2 { max-width: 12ch; font-size: clamp(2.8rem,4.8vw,4.4rem); line-height: 1.08; margin: 8px 0 24px; }
.contact-intro { max-width: 50ch; color: var(--muted); line-height: 1.8; font-size: .9rem; }
.contact-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 22px; align-items: center; margin-top: 25px; padding: 26px 0 38px; }
.contact-email { font-size: clamp(.9rem,2vw,1.35rem); border-bottom: 1px solid var(--accent); padding-bottom: 7px; overflow-wrap: anywhere; }
.social-links { display: flex; gap: 25px; font-size: .73rem; color: var(--muted); }
.social-links a:hover { color: var(--text); }
.footer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 25px 0; font-size: .6rem; color: var(--muted); }
.footer-copy, .footer-status { display: flex; align-items: center; gap: 9px; }
.scroll-progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 50; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.motion-ready .hero-copy, .motion-ready .hero-side { animation: heroEnter .7s ease both; }
.motion-ready .hero-side { animation-delay: .12s; }
.motion-ready .reveal-item { opacity: 0; transform: translateY(14px); transition: opacity .5s ease var(--reveal-delay,0ms), transform .5s ease var(--reveal-delay,0ms); }
.motion-ready .reveal-item.is-visible { opacity: 1; transform: none; }
@keyframes heroEnter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 1050px) {
  .site-shell { width: calc(100% - 56px); }
  .navbar { gap: 20px; }
  .nav-links { gap: 17px; }
  .hero { gap: 40px; }
  .hero-title { font-size: 6rem; }
  .hero-portrait { width: 260px; }
  #experience, .activity-section { gap: 42px; }
  .timeline-head { flex-direction: column; gap: 12px; }
  .timeline-meta { text-align: left; display: flex; flex-wrap: wrap; gap: 8px 15px; }
  .featured-card { gap: 28px; padding: 22px; grid-template-columns: 1.1fr 1fr; }
  .stack-strip { gap: 25px; }
  .stack-strip ul { gap: 15px; font-size: .77rem; }
}
@media (max-width: 800px) {
  .navbar { min-height: 76px; flex-wrap: wrap; }
  .brand { font-size: 30px; }
  .menu-toggle { display: grid; gap: 5px; place-content: center; width: 42px; height: 42px; color: var(--text); background: transparent; border: 1px solid var(--line); border-radius: 50%; }
  .menu-toggle span:not(.sr-only) { display: block; width: 16px; height: 1px; background: currentColor; transition: transform .2s; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav-links, .nav-actions { display: none; width: 100%; }
  .menu-open .navbar { padding-block: 16px; gap: 18px; }
  .menu-open .nav-links { display: flex; flex-wrap: wrap; }
  .menu-open .nav-actions { display: flex; padding-bottom: 6px; }
  .hero { padding: 55px 0 50px; gap: 30px; }
  .hero-title { font-size: 4.6rem; }
  .hero-text { font-size: .9rem; }
  .hero-portrait { width: 220px; }
  .portrait-availability { display: flex; align-items: flex-start; gap: 10px; padding: 0; font-size: .7rem; font-weight: 600; line-height: 1.7; }
  .stack-strip { flex-wrap: wrap; gap: 18px; }
  .stack-strip .section-label { width: 100%; }
  .stack-strip ul { flex-wrap: wrap; justify-content: flex-start; gap: 15px 24px; }
  .section-title-row { display: block; }
  .section-title-row > p { margin-top: 18px; max-width: 48ch; }
  .content-block { margin-top: 72px; }
  .featured-card { grid-template-columns: 1fr; gap: 24px; }
  .featured-card .project-image-wrap { aspect-ratio: 2 / 1; }
  .featured-card .project-body { padding: 0; }
  .featured-card .project-headline-row h3 { font-size: 2rem; margin: 12px 0; }
  .project-image-wrap { padding: 12px; }
  #experience, .activity-section { grid-template-columns: 1fr; gap: 30px; }
  #experience { padding-top: 40px; }
  #experience .section-heading { margin-bottom: 5px; }
  .section-intro { max-width: 60ch; }
  .timeline-head { flex-direction: row; }
  .timeline-meta { display: grid; text-align: right; }
  .activity-section { margin-top: 65px; }
  .activity-caption > p:last-child { max-width: 54ch; }
  #contact { margin-top: 72px; }
}
@media (max-width: 580px) {
  .site-shell { width: calc(100% - 40px); }
  .hero { grid-template-columns: 1fr; gap: 42px; padding-top: 40px; }
  .hero-kicker { font-size: .62rem; margin-bottom: 22px; }
  .hero-title { font-size: clamp(4rem,16vw,5.7rem); margin-bottom: 24px; }
  .hero-text { font-size: .92rem; }
  .hero-actions { gap: 10px; margin-top: 24px; }
  .text-link { padding-inline: 17px; gap: 18px; font-size: .74rem; min-height: 46px; }
  .hero-footnote { font-size: .57rem; }
  .hero-portrait { width: 235px; }
  .portrait-outline { position: absolute; inset: 0 0 12px 14px; border: 1px solid var(--line); border-radius: 160px 160px 12px 12px; z-index: -1; pointer-events: none; }
  .hero-portrait::before { inset-inline: -30px; }
  .portrait-availability { display: flex; align-items: flex-start; gap: 10px; padding: 0; font-size: .7rem; font-weight: 600; line-height: 1.7; }
  .portrait-caption-name { font-size: .64rem; }
  .portrait-location { font-size: .6rem; }
  .stack-strip { padding-block: 22px; }
  .stack-strip ul { font-size: .73rem; gap: 15px 22px; }
  .stack-arrow { display: none; }
  .section-index { font-size: .59rem; margin-bottom: 16px; }
  .section-heading h2 { font-size: 2rem; }
  .section-heading { margin-bottom: 26px; }
  .project-grid { grid-template-columns: 1fr; gap: 35px; }
  .featured-card { padding: 16px; gap: 20px; }
  .featured-card .project-image-wrap { aspect-ratio: 2 / 1; }
  .project-image-wrap { aspect-ratio: 16 / 10; }
  .project-headline-row h3 { font-size: 1.35rem; }
  .project-body > p { font-size: .82rem; }
  .timeline-head { flex-direction: column; }
  .timeline-meta { display: flex; flex-wrap: wrap; text-align: left; }
  .timeline-item { padding-left: 20px; }
  .timeline-head h3 { font-size: 1rem; }
  .contact-layout { gap: 20px; }
  #contact h2 { font-size: 2.8rem; }
  .contact-intro { font-size: .84rem; }
  .contact-bottom { margin-top: 15px; padding-top: 15px; gap: 28px; }
  .contact-email { font-size: .89rem; }
  .social-links { gap: 24px; }
  .footer-bar { font-size: .55rem; gap: 16px; }
  .commit-stats { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 580px) {
  .contact-layout { display: block; }
}

/* Portrait captions flow below the image at every screen size. */
.portrait-visual { position: relative; isolation: isolate; padding: 14px 14px 0 0; }
.portrait-caption-details { display: grid; gap: 10px; }
.portrait-availability .status-dot { margin-top: 6px; }
.contact-heading, .contact-panel { min-width: 0; }
.contact-panel { padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.contact-address { margin: 18px 0 23px; font-size: clamp(.9rem,1.6vw,1.2rem); font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; user-select: all; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-actions .text-link { gap: 12px; padding: 0 16px; min-height: 46px; font-size: .73rem; }
.contact-copy svg { width: 16px; height: 16px; }
.contact-copy[hidden] { display: none; }
.contact-feedback { min-height: 2.8em; margin: 12px 0 16px; color: var(--text); font-size: .73rem; line-height: 1.6; }
.contact-socials { display: grid; gap: 17px; padding-top: 23px; border-top: 1px solid var(--line); }
.contact-socials .social-links { display: flex; flex-wrap: wrap; gap: 14px 25px; }
.contact-socials a { display: inline-flex; gap: 8px; align-items: center; min-height: 32px; color: var(--text); }
.contact-socials a:hover { color: var(--accent); }
@media (max-width: 1050px) { .contact-layout { gap: 35px; } }
@media (max-width: 800px) { .contact-layout { display: grid; grid-template-columns: 1fr; gap: 25px; } }
@media (max-width: 580px) {
  .contact-panel { padding: 20px; }
  .contact-address { font-size: .95rem; }
  .contact-actions { display: grid; grid-template-columns: 1fr; }
  .contact-actions .text-link { justify-content: space-between; }
  .portrait-availability { font-size: .66rem; }
}

.contact-socials .social-icon { display: block; flex: 0 0 16px; width: 16px; height: 16px; }
