/* Foundations */
:root {
    --navy-950: #0b1f35;
    --navy-800: #153b5c;
    --blue-700: #136f8b;
    --teal-600: #0f8b8d;
    --teal-100: #dff4f1;
    --ink: #17253a;
    --muted: #526277;
    --line: #d7e0e8;
    --surface: #ffffff;
    --surface-muted: #f4f8fa;
    --danger: #a82f3d;
    --success: #146c43;
    --shadow: 0 12px 28px rgb(11 31 53 / 8%);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    min-width: 320px;
    margin: 0;
    background-color: var(--surface);
    background-image:
        radial-gradient(circle at 8% -8%, rgb(52 153 184 / 16%), transparent 28rem),
        radial-gradient(circle at 94% 18%, rgb(20 152 143 / 11%), transparent 24rem),
        linear-gradient(rgb(21 76 105 / 4%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(21 76 105 / 4%) 1px, transparent 1px);
    background-size: auto, auto, 32px 32px, 32px 32px;
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.6;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy-950); line-height: 1.18; }
h1 { max-width: 14ch; margin-bottom: 1rem; font-size: clamp(2.25rem, 5vw, 4.25rem); letter-spacing: -0.04em; }
h2 { margin-bottom: .8rem; font-size: clamp(1.65rem, 3vw, 2.35rem); letter-spacing: -0.025em; }
h3 { margin-bottom: .65rem; font-size: 1.15rem; }
p { color: var(--muted); }
a { color: var(--blue-700); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid #e8a520;
    outline-offset: 3px;
}

.container { width: min(1120px, calc(100% - 2.5rem)); margin-inline: auto; }
.narrow-content { width: min(720px, 100%); }
.section { position: relative; padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section-muted { border-block: 1px solid rgb(21 76 105 / 6%); background: linear-gradient(135deg, rgb(244 248 250 / 94%), rgb(237 247 248 / 88%)); }
.section-heading { max-width: 700px; margin-bottom: 2rem; }
.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.lead, .hero-lead { max-width: 66ch; font-size: clamp(1.1rem, 2vw, 1.3rem); }

/* Header and navigation */
.skip-link {
    position: fixed;
    z-index: 10;
    top: .8rem;
    left: .8rem;
    padding: .65rem .9rem;
    transform: translateY(-160%);
    border-radius: .35rem;
    background: #fff;
    color: var(--navy-950);
    box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid rgb(255 255 255 / 12%); background: var(--navy-950); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.6rem; }
.site-brand { color: #fff; font-size: 1.05rem; font-weight: 750; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .8rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem .45rem; }
.site-nav a { padding: .5rem .65rem; border-radius: .3rem; color: #d8e8f3; font-size: .94rem; font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: rgb(255 255 255 / 12%); color: #fff; }
.language-switcher { display: inline-flex; align-items: center; gap: .3rem; padding-left: .8rem; border-left: 1px solid rgb(255 255 255 / 23%); color: #8aa8bc; font-size: .82rem; font-weight: 750; letter-spacing: .04em; }
.language-switcher a { padding: .3rem .15rem; color: #bcd2df; text-decoration: none; }
.language-switcher a:hover, .language-switcher a[aria-current="true"] { color: #fff; text-decoration: underline; text-decoration-thickness: .12em; text-underline-offset: .22em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Hero and content */
.hero { isolation: isolate; overflow: hidden; background: linear-gradient(135deg, rgb(239 249 251 / 94%) 0%, rgb(255 255 255 / 97%) 57%, rgb(227 241 247 / 94%) 100%); }
.hero::before { position: absolute; z-index: -1; inset: 0; opacity: .64; background-image: radial-gradient(circle at 78% 25%, rgb(15 139 141 / 21%) 0 2px, transparent 2.5px), radial-gradient(circle at 72% 38%, rgb(19 111 139 / 17%) 0 2px, transparent 2.5px), linear-gradient(125deg, transparent 42%, rgb(15 139 141 / 13%) 42.15% 42.45%, transparent 42.6%); background-size: 38px 38px, 52px 52px, 100% 100%; content: ""; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, .7fr); align-items: center; gap: clamp(2rem, 7vw, 6rem); }
.hero-copy { padding-block: .75rem; }
.eyebrow { margin-bottom: .8rem; color: var(--teal-600); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.button-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.8rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: .7rem 1.1rem; border: 1px solid transparent; border-radius: .38rem; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--teal-600); color: #fff; }
.button-primary:hover { background: #0b7375; color: #fff; }
.button-secondary { border-color: var(--navy-800); background: transparent; color: var(--navy-800); }
.button-secondary:hover { background: #e7f1f5; }
.hero-panel { position: relative; overflow: hidden; padding: clamp(1.3rem, 3vw, 2rem); border-top: 4px solid var(--teal-600); border-radius: .45rem; background: linear-gradient(145deg, #fff, #f4fbfc); box-shadow: var(--shadow); }
.hero-panel::before { position: absolute; top: -2.5rem; right: -2rem; width: 9rem; height: 9rem; border: 1px solid rgb(15 139 141 / 17%); border-radius: 50%; box-shadow: 0 0 0 1.1rem rgb(15 139 141 / 5%), 0 0 0 2.2rem rgb(19 111 139 / 4%); content: ""; }
.hero-panel > * { position: relative; }
.hero-panel h2 { margin-bottom: 1rem; font-size: 1.15rem; }
.check-list { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 1.55rem; color: var(--muted); }
.check-list li::before { position: absolute; left: 0; color: var(--teal-600); font-weight: 800; content: "✓"; }

.tag-list { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.tag-list li { padding: .35rem .65rem; border: 1px solid #c7e3e4; border-radius: 999px; background: #f9ffff; color: var(--navy-800); font-size: .92rem; font-weight: 650; }
.tag-list-small { gap: .45rem; }
.tag-list-small li { padding: .22rem .5rem; font-size: .78rem; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.card-grid-projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-card { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.5rem; border: 1px solid var(--line); border-top: 3px solid rgb(15 139 141 / 52%); border-radius: .5rem; background: linear-gradient(160deg, #fff, rgb(250 254 254 / 95%)); box-shadow: 0 5px 16px rgb(11 31 53 / 5%); }
.project-card h2, .project-card h3 { font-size: 1.22rem; }
.project-card p { margin-bottom: 0; font-size: .96rem; }
.project-card-detail { justify-content: space-between; min-height: 100%; }
.project-summary { color: var(--navy-800) !important; font-weight: 650; }
.project-footer { display: grid; gap: 1rem; margin-top: auto; }
.project-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.text-link { color: var(--blue-700); font-weight: 750; text-decoration-thickness: .11em; text-underline-offset: .18em; }
.text-link:hover { color: var(--teal-600); }
.approach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.approach-grid article { padding-right: 1.2rem; border-left: 3px solid var(--teal-600); padding-left: 1rem; }
.approach-grid p { margin-bottom: 0; font-size: .95rem; }
.content-stack { display: grid; gap: 2.1rem; }
.content-stack section { padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.content-stack section:last-child { padding-bottom: 0; border-bottom: 0; }
.content-stack h2 { font-size: 1.35rem; }
.empty-state { padding: 2.25rem; border: 1px dashed #aebfca; border-radius: .5rem; background: var(--surface); text-align: center; }
.empty-state h2 { font-size: 1.35rem; }
.empty-state p { margin-bottom: 0; }
.error-page { min-height: 58vh; display: grid; align-items: center; }

/* GitHub presentation */
.github-section { padding-block: clamp(2.75rem, 5vw, 4.5rem); }
.github-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(1rem, 3vw, 2rem); overflow: hidden; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid #b8d9db; border-radius: .6rem; background: linear-gradient(120deg, rgb(247 253 253 / 97%), rgb(231 246 246 / 94%)); box-shadow: var(--shadow); }
.github-card::after { position: absolute; top: -5rem; right: -3rem; width: 18rem; height: 18rem; border: 1px solid rgb(15 139 141 / 13%); border-radius: 50%; box-shadow: 0 0 0 1.6rem rgb(15 139 141 / 4%), 0 0 0 3.2rem rgb(19 111 139 / 3%); content: ""; }
.github-card > * { position: relative; z-index: 1; }
.github-icon-wrap { display: grid; width: 4rem; height: 4rem; place-items: center; border: 1px solid #bee0e1; border-radius: .65rem; background: #fff; box-shadow: 0 5px 14px rgb(11 31 53 / 7%); }
.github-icon-wrap img { display: block; }
.github-copy h2 { margin-bottom: .45rem; font-size: clamp(1.45rem, 2.4vw, 2rem); }
.github-copy .eyebrow { margin-bottom: .45rem; }
.github-copy p:last-child { max-width: 58ch; margin-bottom: 0; }
.github-button { white-space: nowrap; }

/* Forms and messages */
.messages { padding-top: 1.25rem; }
.message { padding: .85rem 1rem; border: 1px solid; border-radius: .4rem; font-weight: 600; }
.message-success { border-color: #9fceb6; background: #edf9f1; color: var(--success); }
.contact-form { display: grid; gap: 1.2rem; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); box-shadow: var(--shadow); }
.form-field { display: grid; gap: .42rem; }
.form-field label { color: var(--navy-950); font-weight: 750; }
.form-field input, .form-field textarea { width: 100%; border: 1px solid #aab9c5; border-radius: .35rem; background: #fff; color: var(--ink); font: inherit; line-height: 1.4; padding: .7rem .75rem; }
.form-field textarea { min-height: 9rem; resize: vertical; }
.form-field input:hover, .form-field textarea:hover { border-color: var(--navy-800); }
.has-error input, .has-error textarea { border-color: var(--danger); }
.field-error, .form-errors { margin: 0; color: var(--danger); font-size: .9rem; }
.field-hint { margin: 0; font-size: .85rem; }
.form-errors { padding: .75rem; border-left: 3px solid var(--danger); background: #fff1f2; }

/* Footer and responsive layout */
.site-footer { background: var(--navy-950); color: #d8e8f3; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 5.25rem; }
.footer-inner p { margin: 0; color: #d8e8f3; font-size: .9rem; }
.footer-inner a { color: #a9e7df; font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 780px) {
    .header-inner { align-items: flex-start; flex-direction: column; gap: .35rem; padding-block: .85rem; }
    .header-actions { align-items: flex-start; flex-wrap: wrap; justify-content: flex-start; gap: .25rem .65rem; }
    .site-nav { margin-left: -.65rem; }
    .language-switcher { min-height: 2.1rem; padding-left: 0; border-left: 0; }
    .hero-grid, .card-grid, .card-grid-projects, .approach-grid, .github-card { grid-template-columns: 1fr; }
    .github-card { gap: 1rem; }
    .github-button { justify-self: start; }
    .section-heading-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
    .container { width: min(100% - 1.5rem, 1120px); }
    .site-nav { gap: .1rem; }
    .site-nav a { padding-inline: .45rem; font-size: .88rem; }
    .github-button { width: 100%; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
