@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/hanken-grotesk-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #eef5f1;
  --ink: #143b35;
  --secondary: #52675f;
  --support: #d9e9e0;
  --card: #f7faf8;
  --rule: #bdcec4;
  --focus: #145547;
  --selection: #b9d9c9;
  --radius: 14px;
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 100%;
  font-weight: 400;
  line-height: 1.55;
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--secondary) var(--paper);
  scrollbar-width: thin;
  caret-color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
strong { font-weight: 650; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--selection); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; border-radius: 3px; }
[hidden] { display: none !important; }

.page-wrap { width: min(100%, 1600px); margin-inline: auto; padding-inline: clamp(1.25rem, 3.2vw, 3rem); }
.site-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 2rem; padding-block: 1.25rem; }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; font-size: clamp(1.375rem, 2.3vw, 2.25rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.035em; text-decoration: none; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem clamp(1rem, 2.4vw, 2.5rem); }
.site-nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 1.125rem; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle:hover { background: var(--support); }
.theme-toggle svg { width: 24px; height: 24px; }
.theme-light-icon { display: none; }
.theme-dark-icon { display: block; }

.studio { display: grid; grid-template-columns: minmax(0, 0.26fr) minmax(0, 0.74fr); align-items: start; gap: 2rem; margin-top: 1rem; }
.intro { min-width: 0; }
.portrait { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: var(--radius); }
.intro-heading { margin-top: 1.75rem; font-size: clamp(2rem, 3.2vw, 3.5rem); line-height: 1.12; letter-spacing: -0.035em; font-weight: 700; }
.intro-copy { margin-top: 1.75rem; color: var(--secondary); font-size: clamp(1.0625rem, 1.35vw, 1.3125rem); line-height: 1.55; }
.intro-copy p + p { margin-top: 1rem; }
.intro-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-top: 1.75rem; }
.intro-links > a:not(.contact-link) { display: inline-flex; align-items: center; min-height: 44px; }
.contact-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 52px; padding: 0.875rem 1.25rem; border-radius: var(--radius); background: var(--support); color: var(--ink); font-weight: 550; line-height: 1.35; text-decoration: none; }
.contact-link:hover { text-decoration: underline; }
.contact-link svg, .project-link svg, .text-link svg, .arrow { width: 24px; height: 24px; flex-shrink: 0; }
.intro .contact-link { width: 100%; font-size: 1.0625rem; }
.portfolio { min-width: 0; }
.featured-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); gap: 1rem; }
.featured-project { min-width: 0; background: var(--support); border-radius: var(--radius); }
.feature-media { position: relative; display: grid; align-items: center; height: clamp(16rem, 24.5vw, 24.5rem); overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: #dfebe4; }
.feature-media > img, .feature-media > a, .feature-media > a > img { width: 100%; height: 100%; min-height: 0; }
.feature-media img { object-fit: cover; }
.catnap-project .feature-media img { object-fit: contain; }
.image-note, .status-badge { position: absolute; z-index: 1; padding: 0.375rem 0.75rem; border-radius: 999px; background: #eef5f1; color: #143b35; font-size: 0.8125rem; font-weight: 500; line-height: 1.35; }
.image-note { left: 1rem; bottom: 1rem; max-width: calc(100% - 2rem); }
.status-badge { top: 1rem; right: 1rem; }
.feature-copy { position: relative; padding: 1rem 1.25rem 1.25rem; }
.feature-copy h2 { font-size: clamp(1.5rem, 2.2vw, 2.25rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; }
.feature-copy p { margin-top: 0.375rem; font-size: 1.0625rem; line-height: 1.4; }
.project-link { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; margin-top: 0.5rem; font-size: 0.9375rem; }
.project-link .arrow { margin-left: 0.25rem; }

.small-projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.small-project { display: flex; flex-direction: column; align-items: start; min-width: 0; padding: 1.25rem; border-radius: var(--radius); background: var(--card); }
.small-project h2 { font-size: clamp(1.25rem, 1.7vw, 1.6875rem); font-weight: 650; line-height: 1.2; letter-spacing: -0.025em; }
.small-project p { margin-top: 0.75rem; color: var(--secondary); font-size: 1rem; line-height: 1.45; }
.text-link { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; margin-top: 0.5rem; font-size: 0.9375rem; }
.small-project .text-link { margin-top: auto; padding-top: 0.75rem; }
.section-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.section-link { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: 1.25rem; border-radius: var(--radius); background: var(--card); text-decoration: none; }
.section-link .icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; padding: 13px; border-radius: 50%; background: var(--support); }
.section-link .icon svg { width: 28px; height: 28px; }
.section-link h2 { font-size: 1.25rem; font-weight: 650; line-height: 1.25; letter-spacing: -0.02em; }
.section-link p { margin-top: 0.375rem; color: var(--secondary); font-size: 1rem; line-height: 1.4; }
.section-link:hover h2 { text-decoration: underline; text-underline-offset: 0.2em; }

.details-wrap { max-width: 1100px; margin-left: auto; margin-top: 5rem; }
.content-section { padding-top: 3rem; border-top: 1px solid var(--rule); }
.content-section + .content-section { margin-top: 5rem; }
.section-heading { margin-bottom: 1.75rem; }
.section-heading h2 { font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.15; font-weight: 650; letter-spacing: -0.03em; }
.section-heading p { margin-top: 0.875rem; max-width: 65ch; }
.lead { max-width: 65ch; color: var(--secondary); font-size: 1.1875rem; line-height: 1.55; }
.content-section p + p { margin-top: 1rem; }
.content-section h3 { font-size: 1.375rem; line-height: 1.3; font-weight: 650; letter-spacing: -0.02em; }
.story-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.story-layout p { max-width: 65ch; font-size: 1.0625rem; }
.story-layout > p + p { margin-top: 0; }
.story-layout p + h3 { margin-top: 1.75rem; margin-bottom: 0.625rem; }
.story-layout > img { border-radius: var(--radius); object-fit: contain; }
.screenshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; margin-top: 2rem; align-items: start; }
.screenshot-link, .image-link { display: block; border-radius: var(--radius); }
.screenshot-link { overflow: hidden; background: var(--support); text-decoration: none; }
.screenshot-link img { width: 100%; object-fit: contain; }
.phone-screenshots { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; width: min(100%, 624px); justify-self: center; }
.screenshot-grid .phone-shot { min-width: 0; }
.screenshot-cue { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 44px; padding: 0.5rem 0.875rem; color: var(--ink); font-size: 0.875rem; font-weight: 500; }
.screenshot-cue svg, .image-action svg { flex-shrink: 0; }
.image-action { display: inline-flex; align-items: center; gap: 0.5rem; }
.feature-media[href] { text-decoration: none; }
.screenshot-link:hover .screenshot-cue, .screenshot-link:focus-visible .screenshot-cue, .feature-media:hover .image-action, .feature-media:focus-visible .image-action { text-decoration: underline; text-underline-offset: 0.2em; }
figcaption { margin-top: 0.625rem; color: var(--secondary); font-size: 0.9375rem; line-height: 1.45; }
.about-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; }
.about-layout p { max-width: 65ch; font-size: 1.0625rem; }
.work-history { display: grid; gap: 0.5rem; }
.work-history dt { margin-bottom: 0.375rem; font-size: 1.125rem; font-weight: 650; }
.work-history dd { color: var(--secondary); font-size: 1rem; }
.work-history > dt:not(:first-child) { margin-top: 1rem; }
.mentoring-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; margin-top: 2rem; }
.mentoring-list article { min-width: 0; }
.mentoring-list p { margin-top: 0.75rem; color: var(--secondary); font-size: 1.0625rem; }
.mentoring-list + p { margin-top: 2rem; }

.photo-gallery { margin-top: 2.5rem; }
.gallery-slides { display: grid; gap: 2rem; }
.gallery-image { overflow: hidden; border-radius: var(--radius); background: var(--support); }
.gallery-image img { width: 100%; border-radius: var(--radius); }
.photo-gallery.is-enhanced .gallery-image { display: grid; place-items: center; height: clamp(22rem, 40vw, 34rem); touch-action: pan-y pinch-zoom; }
.photo-gallery.is-enhanced .gallery-image img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.photo-gallery.is-enhanced figcaption { min-height: 3em; }
.gallery-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.gallery-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-width: 44px; min-height: 44px; padding: 0.625rem 1rem; border: 0; border-radius: 8px; background: var(--support); color: var(--ink); cursor: pointer; }
.gallery-controls button:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.gallery-controls button:disabled { cursor: default; opacity: 0.5; }
.gallery-count { color: var(--secondary); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

footer { margin-top: 5rem; padding-block: 3rem 1.5rem; border-top: 1px solid var(--rule); }
.footer-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.footer-main h2 { font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.15; font-weight: 650; letter-spacing: -0.03em; }
.footer-main p { margin-top: 0.75rem; max-width: 55ch; color: var(--secondary); font-size: 1.0625rem; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--secondary); font-size: 0.9375rem; }
.footer-bottom a { display: inline-flex; align-items: center; min-height: 44px; }
.back-top { display: inline-flex; align-items: center; min-height: 44px; }
.error-page { width: min(100%, 700px); margin: 5rem auto; padding-inline: 1.25rem; }
.error-page h1 { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.035em; }
.error-page p { margin-top: 1.5rem; color: var(--secondary); font-size: 1.125rem; }
.error-page .contact-link { margin-top: 1.5rem; }

.screenshot-dialog { position: fixed; max-width: min(1200px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: 1rem; border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); overflow: auto; }
.screenshot-dialog::backdrop { background: rgb(8 30 23 / 85%); }
.dialog-close { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: 0 0 0.75rem auto; padding: 0.5rem 0.875rem; border: 0; border-radius: 8px; background: var(--support); color: var(--ink); cursor: pointer; }
.dialog-close:hover { text-decoration: underline; }
.dialog-image { width: auto; max-width: 100%; max-height: calc(100dvh - 9rem); margin-inline: auto; object-fit: contain; }
.dialog-caption { margin-top: 0.75rem; color: var(--secondary); font-size: 0.9375rem; }
.skip-link { position: absolute; z-index: 10; top: 0.75rem; left: 0.75rem; padding: 0.75rem 1rem; background: var(--ink); color: var(--paper); border-radius: 8px; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (min-width: 1000px) {
  .intro { position: sticky; top: 1.5rem; }
}

@media (max-width: 1199px) {
  .studio { gap: 1.5rem; }
  .small-project { padding: 1rem; }
  .section-link { grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0.75rem; padding: 1rem; }
  .section-link .icon { width: 2.75rem; height: 2.75rem; padding: 10px; }
  .section-link > .arrow { display: none; }
}

@media (max-width: 999px) {
  .studio { grid-template-columns: minmax(0, 0.29fr) minmax(0, 0.71fr); }
  .intro-heading { font-size: 2rem; }
  .intro-copy { font-size: 1.0625rem; }
  .small-projects { grid-template-columns: 1fr; }
  .small-project { padding: 1.25rem; }
  .small-project h2 { font-size: 1.375rem; }
  .small-project p { margin-top: 0.5rem; }
  .section-links { grid-template-columns: 1fr; }
  .section-link { grid-template-columns: 3rem minmax(0, 1fr) auto; padding: 1.25rem; }
  .section-link > .arrow { display: block; }
}

@media (max-width: 799px) {
  .page-wrap { padding-inline: 1.25rem; }
  .site-header { padding-block: 0.875rem; gap: 0.25rem 1rem; }
  .wordmark { font-size: 1.5rem; }
  .site-nav { gap: 0.125rem 0.75rem; }
  .site-nav a { font-size: 0.9375rem; }
  .studio { grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-top: 1.25rem; }
  .intro { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 1.25rem; }
  .portrait { grid-column: 1; grid-row: 1; width: 90px; height: 90px; border-radius: 12px; }
  .intro-heading { grid-column: 2; grid-row: 1; margin: 0; font-size: clamp(1.875rem, 5.4vw, 2.625rem); line-height: 1.12; }
  .intro-copy { grid-column: 1 / -1; margin: 0; font-size: 1.125rem; line-height: 1.55; }
  .intro-links { grid-column: 1 / -1; margin: 0; }
  .intro .contact-link { width: auto; min-height: 48px; font-size: 1rem; }
  .featured-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .feature-media { height: auto; aspect-ratio: 1.55; }
  .catnap-project .feature-media { aspect-ratio: 1.2; }
  .feature-copy { padding: 1rem 1.25rem; }
  .feature-copy h2 { font-size: 1.875rem; }
  .feature-copy p { font-size: 1.0625rem; line-height: 1.45; }
  .small-projects { gap: 0.875rem; margin-top: 1.5rem; }
  .section-links { gap: 0.875rem; }
  .details-wrap { margin-top: 3.5rem; }
  .content-section { padding-top: 2rem; }
  .content-section + .content-section { margin-top: 3.5rem; }
  .section-heading { margin-bottom: 1.5rem; }
  .section-heading h2 { font-size: 2rem; }
  .lead { font-size: 1.125rem; }
  .story-layout, .about-layout { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .screenshot-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
  .phone-screenshots { gap: 0.875rem; }
  .phone-shot figcaption { font-size: 0.875rem; }
  .mentoring-list { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .photo-gallery { margin-top: 2rem; }
  .photo-gallery.is-enhanced .gallery-image { height: clamp(19rem, 75vw, 28rem); }
  footer { margin-top: 3.5rem; padding-top: 2rem; }
  .footer-main { align-items: start; }
  .footer-main h2 { font-size: 2rem; }
  .footer-bottom { margin-top: 2rem; }
}

@media (max-width: 379px) {
  .page-wrap { padding-inline: 1rem; }
  .wordmark { font-size: 1.375rem; }
  .site-nav a { font-size: 0.875rem; }
  .intro { grid-template-columns: 80px minmax(0, 1fr); gap: 1rem; }
  .portrait { width: 80px; height: 80px; }
  .intro-heading { font-size: 1.875rem; }
  .intro-copy { font-size: 1rem; }
  .intro-links { gap: 0.25rem 1rem; }
  .intro .contact-link { width: 100%; }
  .image-note { left: 0.75rem; bottom: 0.75rem; font-size: 0.75rem; }
  .status-badge { top: 0.75rem; right: 0.75rem; font-size: 0.75rem; }
  .feature-copy, .small-project, .section-link { padding: 1rem; }
  .section-link { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .section-link > .arrow { display: none; }
  .gallery-controls button { padding-inline: 0.75rem; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #192a24;
  --ink: #eef5ec;
  --secondary: #b9cec1;
  --support: #2d473b;
  --card: #20362c;
  --rule: #486352;
  --focus: #c2e7d3;
  --selection: #4c715d;
}
:root[data-theme="dark"] .theme-light-icon { display: block; }
:root[data-theme="dark"] .theme-dark-icon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #192a24;
    --ink: #eef5ec;
    --secondary: #b9cec1;
    --support: #2d473b;
    --card: #20362c;
    --rule: #486352;
    --focus: #c2e7d3;
    --selection: #4c715d;
  }
  :root:not([data-theme="light"]) .theme-light-icon { display: block; }
  :root:not([data-theme="light"]) .theme-dark-icon { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  .featured-project, .small-project, .section-link, .contact-link, .gallery-controls button { border: 1px solid CanvasText; }
  :focus-visible { outline-color: Highlight; }
  .image-note, .status-badge { border: 1px solid CanvasText; }
  .screenshot-dialog { border: 1px solid CanvasText; }
}

@media print {
  :root, :root[data-theme] { color-scheme: light; --paper: #ffffff; --ink: #000000; --secondary: #333333; --support: #f0f0f0; --card: #ffffff; --rule: #aaaaaa; }
  html { scroll-behavior: auto; }
  .page-wrap { max-width: none; padding: 0; }
  .studio, .story-layout, .about-layout { display: block; }
  .intro { position: static; }
  .portrait { max-width: 150px; }
  .intro-heading { font-size: 2rem; }
  .portfolio { margin-top: 2rem; }
  .feature-media { height: auto; aspect-ratio: 1.5; }
  .skip-link, .site-nav, .gallery-controls, .back-top, .screenshot-dialog { display: none !important; }
  .gallery-slide[hidden] { display: block !important; }
  .gallery-slides { display: block; }
  .gallery-slide { margin-bottom: 1.5rem; }
  .photo-gallery.is-enhanced .gallery-image { height: auto; }
  .photo-gallery.is-enhanced .gallery-image img { height: auto; }
  figure, .small-project, .mentoring-list article { break-inside: avoid; }
}
