@import url('./fonts.css');

:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #f2f5f5;
  --ink: #203238;
  --secondary: #53656b;
  --accent: #235a5b;
  --line: #dce3e4;
  --focus: #087f8c;
  --display: 'Archivo', 'Source Sans 3', sans-serif;
  --body: 'Source Sans 3', sans-serif;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #17252a;
  --surface: #213238;
  --ink: #eff4f3;
  --secondary: #b6c7cb;
  --accent: #a8d7d0;
  --line: #3d5057;
  --focus: #a8d7d0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #17252a;
    --surface: #213238;
    --ink: #eff4f3;
    --secondary: #b6c7cb;
    --accent: #a8d7d0;
    --line: #3d5057;
    --focus: #a8d7d0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body { margin: 0; font: 400 19px/1.6 var(--body); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
body, button, a, summary { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 5px; }
a:hover { color: var(--accent); }
button, summary { cursor: pointer; }
button { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
button, a, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: 2px; }
[tabindex='-1']:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--paper); }
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; }
h1, h2 { text-wrap: balance; }
.container { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.muted { color: var(--secondary); }
.skip-link { position: fixed; top: 12px; left: 16px; z-index: 50; padding: 10px 18px; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { height: 92px; display: flex; align-items: center; gap: 30px; }
.brand { font-family: var(--display); font-size: 18px; font-weight: 600; text-decoration: none; white-space: nowrap; letter-spacing: -.5px; }
.desktop-nav { margin-left: auto; }
.nav-links { display: flex; align-items: center; gap: 25px; }
.nav-links a { color: var(--secondary); text-decoration: none; font-size: 16px; padding-block: 12px; }
.nav-links a:hover { color: var(--accent); text-decoration: underline; }
.utilities { display: flex; align-items: center; gap: 8px; }
.language-menu, .mobile-nav { position: relative; }
.language-menu summary { list-style: none; display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px; font-size: 14px; }
summary::-webkit-details-marker { display: none; }
.language-menu summary svg { width: 13px; height: 13px; }
.language-options { position: absolute; top: calc(100% + 10px); right: 0; min-width: 156px; max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain; padding: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; box-shadow: 0 8px 28px #102a3320; }
.language-options a { display: block; padding: 7px 12px; min-height: 44px; text-decoration: none; font-size: 17px; }
.language-options a:hover, .language-options a[aria-current] { background: var(--surface); }
.language-options a[aria-current] { font-weight: 600; }
.theme-toggle { width: 44px; height: 44px; border: none; background: transparent; display: grid; place-items: center; border-radius: 50%; }
.theme-toggle:hover { background: var(--surface); }
.theme-toggle .sun, [data-theme='dark'] .theme-toggle .moon { display: none; }
[data-theme='dark'] .theme-toggle .sun { display: block; }
.mobile-nav { display: none; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: center; gap: 92px; padding: 84px 0 92px; }
.greeting { font-size: 23px; margin-bottom: 14px; color: var(--secondary); }
.hero h1 { font-size: clamp(56px, 6.1vw, 88px); line-height: 1.02; font-weight: 600; letter-spacing: -.045em; margin-left: -5px; }
.hero h1 span { display: block; }
.hero-role { font-size: 20px; color: var(--accent); margin-top: 22px; }
.hero-intro { font-size: 22px; line-height: 1.5; color: var(--secondary); max-width: 510px; margin-top: 14px; }
.hero-actions { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; margin-top: 32px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 21px; background: var(--accent); color: var(--paper); border: 1px solid var(--accent); border-radius: 5px; text-decoration: none; font-size: 17px; font-weight: 600; }
.button:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 17px; }
.portrait { align-self: center; }
.portrait img { width: 290px; aspect-ratio: 1; border-radius: 50%; }

.section { padding-block: 70px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.section-heading h2, .about-copy h2 { font-size: 32px; line-height: 1.2; letter-spacing: -1px; }
.section-heading p { font-size: 18px; color: var(--secondary); }
.featured-projects { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.project { min-width: 0; }
.project-image { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.project-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.project-image:hover { border-color: var(--accent); }
.project-heading { margin-top: 24px; display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.project h3 { font-size: 25px; letter-spacing: -.75px; }
.project h3 a { text-decoration: none; }
.project-heading > a { font-size: 16px; white-space: nowrap; }
.project-description { color: var(--secondary); font-size: 19px; margin-top: 10px; max-width: 48ch; }
.project-tech { font-size: 15px; margin-top: 17px; color: var(--secondary); }
.live-projects { margin-top: 40px; }
.live-projects + .other-projects { margin-top: 12px; }
.other-projects { margin-top: 40px; }
.other-projects > summary { display: flex; align-items: center; gap: 12px; list-style: none; font-size: 17px; width: fit-content; min-height: 48px; }
.other-projects > summary::before { content: '+'; display: grid; place-items: center; width: 25px; font-size: 25px; font-weight: 400; }
.other-projects[open] > summary::before { content: '−'; }
.other-projects > summary .count { color: var(--secondary); }
.project-notes { margin-top: 12px; }
.project-note { display: grid; grid-template-columns: 200px 1fr; column-gap: 42px; padding-block: 23px; border-top: 1px solid var(--line); }
.project-note h3 { font-size: 19px; line-height: 1.6; letter-spacing: -.4px; overflow-wrap: anywhere; }
.project-note p { color: var(--secondary); }
.project-note .project-tech { margin-top: 8px; }
.project-note .text-link { margin-top: 4px; font-size: 16px; }
.project-details { margin-top: 16px; font-size: 17px; }
.project-details summary { width: fit-content; min-height: 44px; padding-block: 8px; color: var(--accent); }
.project-details p { margin-top: 10px; color: var(--secondary); }
.project-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
.project-links .text-link { font-size: 16px; }

.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 104px; }
.about-copy h2 { margin-bottom: 27px; }
.about-copy p { color: var(--secondary); max-width: 55ch; }
.about-copy p + p { margin-top: 18px; }
.about-copy .text-link { margin-top: 25px; }
.skills h2 { font-size: 22px; line-height: 1.5; letter-spacing: -.65px; margin-bottom: 24px; }
.skill-group + .skill-group { margin-top: 24px; }
.skill-group h3 { font: 600 17px/1.5 var(--body); margin-bottom: 6px; }
.skill-group p { color: var(--secondary); font-size: 18px; }
.writing-layout { display: grid; grid-template-columns: 260px 1fr; gap: 64px; }
.writing-layout .section-heading { display: block; }
.writing-layout .section-heading p { margin-top: 15px; max-width: 24ch; }
.post-date { font-size: 16px; color: var(--secondary); display: flex; flex-wrap: wrap; column-gap: 22px; margin-bottom: 14px; }
.post h3 { font-size: 28px; line-height: 1.3; letter-spacing: -.7px; max-width: 28ch; }
.post h3 a { text-decoration: none; }
.post h3 a:hover { text-decoration: underline; }
.post p { margin-top: 17px; color: var(--secondary); max-width: 58ch; }
.post .text-link { margin-top: 17px; }
.contact { background: var(--surface); padding: 58px 60px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 45px; margin-block: 0 72px; }
.contact h2 { font-size: 34px; line-height: 1.2; letter-spacing: -1.1px; max-width: 20ch; }
.contact p { font-size: 19px; color: var(--secondary); max-width: 40ch; margin-top: 16px; }
.contact-email { display: inline-block; overflow-wrap: anywhere; font-size: 21px; margin-bottom: 15px; }
.social-links { display: flex; flex-wrap: wrap; gap: 24px; }
.social-links a { font-size: 17px; display: inline-flex; align-items: center; min-height: 44px; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 16px; color: var(--secondary); }
.footer-inner a { min-height: 44px; display: inline-flex; align-items: center; }

.article { max-width: 730px; margin: 0 auto; padding-block: 58px 84px; }
.article-back { margin-bottom: 48px; }
.article h1 { font-size: clamp(34px, 4vw, 49px); line-height: 1.17; letter-spacing: -1.5px; margin-bottom: 26px; }
.article-byline { color: var(--secondary); font-size: 17px; display: flex; flex-wrap: wrap; gap: 6px 25px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.prose { padding-top: 38px; }
.prose p { margin-bottom: 25px; font-size: 21px; line-height: 1.8; }
.article-end { margin-top: 42px; border-top: 1px solid var(--line); padding-top: 23px; }
.not-found { min-height: 65vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 24px; }
.not-found h1 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -1.5px; }
.not-found p { max-width: 48ch; }

@media (max-width: 1100px) {
  .header-inner { gap: 20px; }
  .nav-links { gap: 18px; }
  .hero { gap: 48px; grid-template-columns: 1fr 250px; }
  .portrait img { width: 250px; }
  .about-grid { gap: 64px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 12px; }
  .project-heading { display: block; }
  .project-heading > a { display: inline-block; margin-top: 5px; min-height: 36px; }
  .contact { padding: 42px; }
  .contact-email { font-size: 19px; }
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .utilities { margin-left: auto; }
  .mobile-nav { display: block; position: static; }
  .mobile-nav summary { list-style: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding-inline: 6px; font-size: 16px; }
  .mobile-nav .nav-links { position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100dvh - 92px); overflow-y: auto; overscroll-behavior: contain; padding: 12px 40px 20px; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: stretch; flex-direction: column; gap: 0; box-shadow: 0 12px 18px #102a330a; }
  .mobile-nav .nav-links a { font-size: 19px; min-height: 48px; }
  .hero { gap: 36px; grid-template-columns: 1fr 210px; }
  .portrait img { width: 210px; }
  .hero h1 { font-size: 66px; }
  .hero-intro { font-size: 21px; }
  .featured-projects { gap: 26px; }
  .about-grid { gap: 44px; }
  .writing-layout { grid-template-columns: 200px 1fr; gap: 40px; }
  .contact { display: block; }
  .contact-links { margin-top: 28px; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 90px; }
  body { font-size: 18px; }
  .container { width: calc(100% - 40px); }
  .header-inner { height: 76px; gap: 8px; }
  .brand { font-size: 16px; letter-spacing: -.5px; }
  .utilities { gap: 0; }
  .language-menu summary { padding-inline: 7px; }
  .theme-toggle { width: 40px; }
  .mobile-nav summary { padding-left: 8px; }
  .mobile-nav summary span { display: none; }
  .mobile-nav .nav-links { padding-inline: 22px; max-height: calc(100dvh - 76px); }
  .hero { position: relative; display: block; padding: 52px 0 54px; }
  .greeting { font-size: 20px; margin-bottom: 16px; }
  .hero h1 { font-size: clamp(53px, 10.9vw, 69px); letter-spacing: -.045em; max-width: 370px; margin-left: -2px; }
  .portrait { position: absolute; right: 0; top: 42px; width: 88px; }
  .portrait img { width: 88px; }
  .hero-role { margin-top: 23px; font-size: 18px; max-width: 30ch; }
  .hero-intro { font-size: 20px; margin-top: 13px; max-width: 38ch; }
  .hero-actions { gap: 12px 22px; margin-top: 26px; }
  .button, .text-link { font-size: 16px; }
  .section { padding-block: 46px; }
  .section-heading { margin-bottom: 27px; }
  .section-heading h2, .about-copy h2 { font-size: 27px; letter-spacing: -.8px; }
  .section-heading p { font-size: 18px; }
  .featured-projects { grid-template-columns: 1fr; gap: 36px; }
  .project-heading { display: flex; margin-top: 17px; gap: 8px; }
  .project-heading > a { margin-top: 0; font-size: 15px; }
  .project h3 { font-size: 23px; }
  .project-description { margin-top: 6px; font-size: 18px; }
  .project-tech { margin-top: 12px; font-size: 14px; }
  .other-projects { margin-top: 25px; }
  .project-note { grid-template-columns: 1fr; gap: 7px; padding-block: 20px; }
  .about-grid { grid-template-columns: 1fr; gap: 38px; }
  .about-copy h2 { margin-bottom: 21px; }
  .skills h2 { font-size: 22px; margin-bottom: 18px; }
  .skill-group + .skill-group { margin-top: 18px; }
  .writing-layout { grid-template-columns: 1fr; gap: 0; }
  .writing-layout .section-heading p { max-width: none; }
  .post h3 { font-size: 25px; }
  .post p { font-size: 18px; }
  .contact { padding: 29px 24px; margin-bottom: 42px; }
  .contact h2 { font-size: 28px; }
  .contact p { font-size: 18px; }
  .contact-email { font-size: 18px; }
  .social-links { gap: 22px; }
  .footer-inner { min-height: 100px; font-size: 14px; }
  .article { padding-block: 32px 52px; }
  .article-back { margin-bottom: 32px; }
  .article h1 { font-size: 34px; letter-spacing: -1px; }
  .article-byline { font-size: 16px; padding-bottom: 24px; }
  .prose { padding-top: 27px; }
  .prose p { font-size: 19px; line-height: 1.75; }
}

@media (max-width: 370px) {
  .brand { font-size: 14px; }
  .header-inner { gap: 4px; }
  .portrait { width: 68px; top: 47px; }
  .portrait img { width: 68px; }
  .hero h1 { font-size: 51px; }
  .project-heading { display: block; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  :root, :root[data-theme], :root:not([data-theme]) { color-scheme: light; --paper: #fff; --surface: #fff; --ink: #000; --secondary: #333; --accent: #000; --line: #ccc; --focus: #000; }
  body { font-size: 12pt; }
  .site-header, .site-footer, .hero-actions, .skip-link, .article-back, .theme-toggle, .article-end { display: none; }
  .container { width: 100%; }
  .hero, .section { padding-block: 24px; }
  .article { padding: 0; max-width: none; }
  .prose p { font-size: 12pt; }
  .project, .skill-group { break-inside: avoid; }
}
