:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-strong: #ebe5d8;
  --text: #17221f;
  --muted: #5c6964;
  --line: #d7d2c7;
  --accent: #d4572f;
  --accent-dark: #a53b21;
  --ink-inverse: #fffaf2;
  --shadow: 0 16px 45px rgba(29, 42, 37, .09);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Trebuchet MS', Verdana, sans-serif;
}

body.dark-mode {
  --bg: #121918;
  --surface: #1b2421;
  --surface-strong: #25322e;
  --text: #edf2e9;
  --muted: #aab8af;
  --line: #35443e;
  --accent: #ef835b;
  --accent-dark: #ffab8b;
  --ink-inverse: #13201c;
  --shadow: 0 16px 45px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.65; transition: background .25s ease, color .25s ease; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: var(--ink-inverse); padding: 10px 16px; border-radius: 6px; text-decoration: none; transition: top .2s ease; }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 93%, transparent); backdrop-filter: blur(14px); }
.header-inner { width: min(1160px, calc(100% - 40px)); min-height: 78px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { color: var(--text); font-family: var(--serif); font-size: 1.35rem; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.brand span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a, .theme-toggle, .menu-toggle { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; padding: 9px 11px; text-decoration: none; cursor: pointer; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }
.site-nav a.active { border-bottom: 2px solid var(--accent); }
.theme-toggle { border: 1px solid var(--line); border-radius: 999px; }
.menu-toggle { display: none; border: 1px solid var(--line); border-radius: 999px; }

.page-shell { width: min(1160px, calc(100% - 40px)); margin: auto; }
.page-main { padding-top: 88px; padding-bottom: 100px; }
.hero { min-height: 680px; padding-top: 110px; padding-bottom: 100px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); align-items: center; gap: 80px; }
.hero-copy, .intro-block { animation: rise-in .65s ease both; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--serif); line-height: 1.08; letter-spacing: -.02em; }
h1 { max-width: 760px; margin-bottom: 26px; font-size: clamp(3rem, 7vw, 6.7rem); }
h2 { margin-bottom: 16px; font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { margin-bottom: 10px; line-height: 1.2; }
.hero-lede, .lead { max-width: 680px; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 18px; border: 1px solid var(--accent); border-radius: 4px; font-size: .9rem; font-weight: 700; text-decoration: none; transition: transform .2s ease, background .2s ease, color .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--accent); color: var(--ink-inverse); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { color: var(--accent-dark); }
.button-secondary:hover { background: var(--surface-strong); }
.social-row { display: flex; gap: 22px; color: var(--muted); font-size: .9rem; }
.social-row a, .text-link, .contact-card a { text-decoration: none; }
.social-row a:hover, .text-link:hover, .contact-card a:hover { color: var(--accent); }
.hero-panel { display: grid; gap: 10px; padding: 28px; border-left: 1px solid var(--accent); color: var(--muted); font-family: var(--serif); font-size: 1.12rem; animation: rise-in .75s .1s ease both; }
.hero-panel b { color: var(--accent); font-family: var(--sans); font-size: .9rem; }
.hero-panel strong { color: var(--text); font-size: 1.35rem; }

.section-block, .project-section { padding-top: 82px; }
.section-heading { max-width: 680px; margin-bottom: 30px; }
.section-heading > p:last-child { color: var(--muted); }
.card-grid, .project-grid, .skills-grid, .contact-grid, .certificate-grid { display: grid; gap: 16px; }
.build-grid { grid-template-columns: repeat(3, 1fr); }
.feature-card, .project-card, .contact-card, .certificate-card, .skill-group { border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.feature-card, .contact-card, .certificate-card, .skill-group { padding: 24px; }
.feature-card { min-height: 190px; }
.feature-card p, .project-card p, .contact-card p, .certificate-card p, .skill-group { color: var(--muted); }
.card-index { display: block; margin-bottom: 20px; color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .14em; }
.skills-grid { grid-template-columns: repeat(2, 1fr); }
.skill-group:last-child { grid-column: 1 / -1; }
.skill-group h3 { color: var(--text); }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list span { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .72rem; line-height: 1.4; }

.intro-block { max-width: 820px; margin-bottom: 40px; }
.intro-block h1 { font-size: clamp(3rem, 7vw, 5.8rem); }
.split-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: 70px; padding: 72px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.focus-list { display: flex; flex-wrap: wrap; align-content: start; gap: 10px; }
.focus-list span { padding: 10px 13px; background: var(--surface-strong); color: var(--text); font-size: .85rem; }
.philosophy { max-width: 760px; padding: 90px 0 20px; }
.philosophy p:last-child { color: var(--muted); font-size: 1.1rem; }
.about-grid { grid-template-columns: repeat(3, 1fr); }

.project-section { scroll-margin-top: 90px; }
.project-grid { grid-template-columns: repeat(2, 1fr); }
.project-card { min-height: 260px; padding: 25px; display: flex; flex-direction: column; justify-content: space-between; }
.project-card.featured { border-top: 3px solid var(--accent); }
.project-card h3 { color: var(--text); font-family: var(--serif); font-size: 1.5rem; }
.project-card p { max-width: 580px; }
.project-type { display: block; margin-bottom: 15px; color: var(--accent); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.text-link { display: inline-block; margin-top: 22px; color: var(--accent-dark); font-size: .88rem; font-weight: 700; }
.compact-grid .project-card { min-height: 220px; }

.contact-grid, .certificate-grid { grid-template-columns: repeat(3, 1fr); }
.contact-card h2, .certificate-card h2 { font-size: 1.65rem; }
.contact-card a { color: var(--accent-dark); overflow-wrap: anywhere; }
.certificate-card { min-height: 220px; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); }
.footer-inner { width: min(1160px, calc(100% - 40px)); min-height: 110px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: .85rem; }
.footer-inner p { margin: 0; }
.footer-inner div { display: flex; gap: 18px; }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media (max-width: 800px) {
  .header-inner { min-height: 68px; }
  .menu-toggle { display: block; }
  .site-nav { position: absolute; top: 68px; left: 0; right: 0; display: none; padding: 12px 20px 18px; border-bottom: 1px solid var(--line); background: var(--bg); flex-direction: column; align-items: stretch; }
  .site-nav.is-open { display: flex; }
  .site-nav a, .theme-toggle { text-align: left; }
  .hero { min-height: 0; padding-top: 80px; grid-template-columns: 1fr; gap: 45px; }
  .build-grid, .about-grid, .contact-grid, .certificate-grid { grid-template-columns: 1fr 1fr; }
  .split-section { grid-template-columns: 1fr; gap: 25px; }
}
@media (max-width: 560px) {
  .page-shell, .header-inner, .footer-inner { width: min(100% - 28px, 1160px); }
  .page-main { padding-top: 58px; padding-bottom: 65px; }
  .hero { padding-top: 60px; padding-bottom: 65px; }
  h1, .intro-block h1 { font-size: clamp(2.65rem, 14vw, 4rem); }
  .build-grid, .skills-grid, .project-grid, .about-grid, .contact-grid, .certificate-grid { grid-template-columns: 1fr; }
  .skill-group:last-child { grid-column: auto; }
  .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; }
}
