:root {
  color-scheme: dark;
  --bg: #0a0e17;
  --surface: #0e131f;
  --panel: #151c2b;
  --border: #283247;
  --ink: #eef2f8;
  --muted: #a4b2c7;
  --violet: #b3a4ff;
  --cyan: #48cee6;
  --accent: linear-gradient(110deg, #b89aff, #908cfa 48%, #38d0e8);
  --button: linear-gradient(110deg, #6548d3, #7143bf 52%, #00738d);
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 1.4rem;
  --wrap: 75rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body { margin: 0; min-width: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 1rem/1.65 system-ui, "Segoe UI", sans-serif; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
h2 { font-size: clamp(1.65rem, 3.3vw, 2.5rem); }
.card-title { font-size: clamp(1.18rem, 2.1vw, 1.5rem); }
button, select, input, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; }
.wrap { width: min(var(--wrap), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.reading { width: min(46rem, calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.muted { color: var(--muted); }
.gradient { color: var(--violet); background: var(--accent); background-clip: text; -webkit-text-fill-color: transparent; }
.skip-link { z-index: 10; position: fixed; top: .5rem; left: .5rem; transform: translateY(-150%); background: var(--panel); padding: .65rem 1rem; border-radius: .5rem; }
.skip-link:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 5; background: #0c111cf2; border-bottom: 1px solid #212a40; }
.header-inner { display: grid; grid-template-columns: minmax(8rem, 1fr) auto minmax(3rem, 1fr); align-items: center; min-height: 4.75rem; gap: 1rem; }
.brand { display: inline-flex; align-items: center; justify-self: start; font: 700 1.53rem/1 var(--mono); letter-spacing: -.07em; min-height: 2.75rem; width: fit-content; }
.brand-icon { width: 3.25rem; height: auto; margin-right: .7rem; object-fit: contain; }
.brand-dot { color: var(--cyan); }
.nav { display: flex; gap: .25rem; align-items: center; }
.nav a { display: grid; place-items: center; min-height: 2.75rem; padding: .35rem .78rem; border-radius: .65rem; color: var(--muted); font-size: .94rem; font-weight: 650; white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { background: #191c37; color: var(--ink); }
.nav a[aria-current] { text-decoration: underline; text-decoration-color: #a08cff; text-decoration-thickness: 2px; text-underline-offset: .32rem; }
.search-link, .menu-toggle { display: grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem; border: 1px solid var(--border); border-radius: .7rem; background: #141b2a; color: var(--ink); }
.search-link { justify-self: end; }
.search-link span { width: .9rem; height: .9rem; border: 2px solid var(--muted); border-radius: 50%; position: relative; }
.search-link span::after { position: absolute; content: ""; background: var(--muted); width: .4rem; height: 2px; transform: rotate(45deg); right: -.3rem; bottom: -.13rem; }
.menu-toggle { padding: 0 .75rem; }

.home-hero, .page-hero {
  --ambient-offset: 6%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid #1d293a;
}

:is(.home-hero, .page-hero)::before,
:is(.home-hero, .page-hero)::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

:is(.home-hero, .page-hero)::before {
  inset: -10%;
  z-index: -2;
  background:
    radial-gradient(ellipse at 18% 16%, #4e3b8870, transparent 55%),
    radial-gradient(ellipse at 81% 83%, #08728465, transparent 53%),
    radial-gradient(ellipse at 57% 59%, #38255845, transparent 56%);
}

:is(.home-hero, .page-hero)::after {
  inset: -1rem;
  z-index: -1;
  background:
    radial-gradient(circle at 14% 20%, #b49aff7a 1.2px, transparent 2.5px),
    radial-gradient(circle at 25% 72%, #6bc8de73 1px, transparent 2.6px),
    radial-gradient(circle at 40% 32%, #9893fa80 1px, transparent 2.4px),
    radial-gradient(circle at 54% 78%, #998ef069 1.1px, transparent 2.4px),
    radial-gradient(circle at 68% 23%, #86cce76e 1px, transparent 2.6px),
    radial-gradient(circle at 77% 61%, #83dcf070 1.1px, transparent 2.6px),
    radial-gradient(circle at 88% 33%, #a799f269 1px, transparent 2.2px),
    radial-gradient(circle at 92% 80%, #69cee56b 1.2px, transparent 2.6px),
    radial-gradient(circle, #9eabe223 1px, transparent 1.25px) center / 2rem 2rem;
}

.hero-inner { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); align-items: center; gap: clamp(1.7rem, 6vw, 6rem); padding-block: clamp(3rem, 7.8vw, 7rem); }
.hero-content { display: grid; justify-items: start; align-content: center; gap: 1rem; min-width: 0; }
.portrait-frame { position: relative; justify-self: center; isolation: isolate; width: min(100%, 23rem); aspect-ratio: 1; border-radius: clamp(1.5rem, 4vw, 2.8rem); padding: .25rem; background: var(--accent); box-shadow: 0 1.25rem 5rem #141345ae; }
.portrait-frame::before { content: ""; position: absolute; z-index: -1; inset: .65rem -.65rem -.65rem .65rem; border: 1px solid #a68cf464; border-radius: inherit; pointer-events: none; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; border-radius: calc(clamp(1.5rem, 4vw, 2.8rem) - .25rem); }
.eyebrow { width: fit-content; padding: .42rem .85rem; border: 1px solid #8375bb55; border-radius: 3rem; background: #141b2c; color: var(--violet); font: 650 .83rem/1.55 var(--mono); }
.hero-kicker span { color: var(--cyan); padding-inline: .22rem; }
.hero-inner h1 { font-size: clamp(2.35rem, 5.5vw, 5rem); font-weight: 770; letter-spacing: -.06em; }
.hero-inner h1 .gradient { display: block; }
.hero-copy { max-width: 39rem; color: var(--muted); font-size: clamp(1.02rem, 2.2vw, 1.24rem); text-wrap: pretty; }
.about-hero .hero-inner { grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); }
.about-hero h1 { font-size: clamp(2.35rem, 5.1vw, 4.35rem); }
.about-hero .hero-copy { max-width: 44rem; }
.page-hero { padding-block: clamp(2.8rem, 8vw, 5rem); }
.page-hero h1 { font-size: clamp(2.3rem, 5.8vw, 4.25rem); margin: .8rem 0 .65rem; }
.page-hero p:last-child { max-width: 43rem; color: var(--muted); font-size: clamp(1.03rem, 2vw, 1.2rem); }

.actions, .socials, .chips { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.hero-content .actions { margin-top: .2rem; }
.hero-content .socials { margin-top: .25rem; }
.footer-nav a, .back-top { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--muted); }
.footer-nav a:hover, .back-top:hover { color: var(--ink); }
.social-button { display: grid; place-items: center; width: 2.85rem; height: 2.85rem; border-radius: .75rem; border: 1px solid var(--border); background: #121927; color: var(--social-color, var(--ink)); }
.social-button:hover { border-color: var(--social-color, var(--violet)); background: #1b2438; }
.social-icon { inline-size: 1.25rem; block-size: 1.25rem; flex: 0 0 1.25rem; fill: currentColor; }
.social-email { --social-color: #ff9a91; }
.social-youtube { --social-color: #ff7478; }
.social-facebook { --social-color: #86b4ff; }
.social-instagram { --social-color: #ffa0d4; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem; padding: .65rem 1.25rem; border: 1px solid transparent; border-radius: 2rem; font-weight: 720; text-align: center; }
.button-primary { color: white; background: var(--button); box-shadow: 0 .45rem 1.8rem #5944d340; }
.button-secondary { background: #192133; border-color: var(--border); }
.button:hover { border-color: #a99bf5; }
.text-link, .email-link { color: var(--violet); text-underline-offset: .2em; }
.text-link { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 680; }
.text-link:hover, .email-link:hover { text-decoration: underline; }
.email-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; max-width: 100%; overflow-wrap: anywhere; }
.email-link .social-icon { color: var(--social-color); }

.section { padding-block: clamp(2.25rem, 5.5vw, 4.5rem); }
.section + .section { padding-top: 0; }
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .65rem 1rem; margin-bottom: 1.3rem; }
.grid { display: grid; gap: 1rem; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; padding: clamp(1.15rem, 2.5vw, 1.7rem); border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(148deg, #181f30, #101725 65%); }
.card p { color: var(--muted); }
.post-card, .topic-card { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.post-card .card-title a:hover { color: var(--violet); }
.post-card .text-link, .topic-card .muted { margin-top: auto; }
.tag, .tag.tag { display: inline-flex; width: fit-content; align-items: center; background: #252349; color: #c7b9ff; border-radius: 2rem; padding: .3rem .68rem; font: 650 .81rem/1.5 var(--mono); }
.tag.tag-frontend, .topic-icon.tag-frontend { color: #ffc0e0; background: #3d2442; }
.tag.tag-ai, .tag.tag-database, .topic-icon.tag-ai, .topic-icon.tag-database { color: #9ae8ff; background: #113649; }
.tag.tag-devops, .topic-icon.tag-devops { color: #a6eddd; background: #143e3c; }
.topic-card:hover { border-color: #7770ad; }
.topic-icon { display: grid; place-items: center; min-width: 2.65rem; height: 2.65rem; padding-inline: .4rem; border-radius: .7rem; background: #252349; color: #c7b9ff; font: 700 .95rem/1 var(--mono); }

.project-card { display: grid; grid-template-columns: 1fr 1fr; align-items: center; padding: 0; overflow: hidden; }
.project-art { display: grid; place-items: center; align-self: stretch; min-height: 15rem; padding: 1.4rem; border-right: 1px solid var(--border); background: radial-gradient(ellipse at 55% 94%, #0b5863, transparent 65%), radial-gradient(ellipse at 12% 6%, #463579, transparent 65%), #141b2d; }
.terminal { display: grid; grid-template-columns: 1fr auto; gap: .55rem .9rem; width: min(100%, 21rem); padding: 1rem; border: 1px solid #8f83b369; border-radius: 1rem; background: #111726; color: #bcb3e3; font: 550 .85rem/1.5 var(--mono); }
.terminal span:nth-child(n+3) { grid-column: 1 / -1; padding: .36rem .6rem; background: #1a2236; border-radius: .35rem; }
.terminal i { display: inline-block; width: .4rem; height: .4rem; margin-left: .25rem; border-radius: 50%; background: #9d89ff; }
.terminal i:nth-child(2) { background: #59c8d9; }
.terminal i:nth-child(3) { background: #f3a7d0; }
.project-copy { padding: clamp(1.2rem, 4vw, 2.75rem); display: grid; justify-items: start; gap: .85rem; }
.chips li { border: 1px solid var(--border); color: var(--muted); padding: .2rem .45rem; border-radius: .4rem; font: .8rem/1.5 var(--mono); }
.contact-callout { display: flex; gap: 1rem; justify-content: space-between; align-items: center; padding: clamp(1.25rem, 4vw, 3rem); }
.contact-callout p { margin-top: .5rem; }

.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, .42fr); gap: 1rem; align-items: end; margin-bottom: .85rem; }
.filters label, .contact-form label { display: grid; gap: .35rem; font-weight: 660; }
input, select, textarea { width: 100%; min-height: 2.9rem; padding: .58rem .82rem; border-radius: .68rem; background: #1a2333; border: 1px solid #485472; }
input::placeholder { color: #a4b2c7; }
textarea { resize: vertical; }
.listing #article-count, .listing #no-articles { margin-bottom: .85rem; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .59fr); gap: 1rem; align-items: start; }
.contact-form form { display: grid; margin-top: 1.35rem; gap: .48rem; }
.contact-form form > label:not(:first-of-type) { margin-top: .6rem; }
.contact-form form .button { margin-top: .5rem; }
.form-note { font-size: .9rem; }
.form-note a { text-decoration: underline; text-underline-offset: .18em; }
.contact-person { overflow: hidden; padding: 0; }
.contact-person img { width: 100%; height: clamp(14rem, 31vw, 21rem); object-fit: cover; object-position: 50% 36%; }
.contact-person > div { padding: clamp(1rem, 2vw, 1.5rem); }
.contact-person h2 { font-size: clamp(1.35rem, 2.5vw, 1.8rem); }
.contact-person .socials { margin-top: .9rem; }

.article-hero .tag { margin-top: .6rem; }
.article-hero .text-link { display: flex; width: fit-content; }
.article-hero h1 { font-size: clamp(2.1rem, 5vw, 3.75rem); }
.article-body { padding-block: 2.4rem 3rem; font-size: 1.07rem; }
.article-body p + p { margin-top: 1rem; }
.article-body pre { margin: 1rem 0 1.4rem; padding: 1.15rem; overflow-x: auto; border: 1px solid var(--border); border-radius: .85rem; background: #111a28; color: #d2e2fc; font: .88rem/1.6 var(--mono); }
.article-body code { font: inherit; }
.article-end:not(:empty) { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: .5rem; }
.article-end:empty { display: none; }

.site-footer { background: var(--surface); border-top: 1px solid #232c3d; padding: 2.6rem 0 1rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, .65fr) minmax(0, 1fr); gap: 1.25rem; }
.footer-grid p { color: var(--muted); }
.footer-grid h2 { font-size: 1.05rem; margin: .75rem 0 .45rem; }
.footer-grid .socials { margin-top: .75rem; }
.school-logo { width: 7.5rem; height: auto; margin-top: .8rem; object-fit: contain; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 .9rem; }
.footer-end { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; border-top: 1px solid var(--border); margin-top: 1.6rem; padding-top: .55rem; color: var(--muted); }

.pending-reveal { opacity: 0; transform: translateY(1rem); }
.pending-reveal:focus-within { opacity: 1; transform: none; }
.revealed { transition: opacity .45s ease-out, transform .45s ease-out; }

@view-transition {
  navigation: auto;
}

@media (prefers-reduced-motion: no-preference) {
  :is(.home-hero, .page-hero)::before { animation: ambient-glow 4.6s cubic-bezier(.25, .65, .3, 1); }
  :is(.home-hero, .page-hero)::after { animation: ambient-stars 4.4s ease-out; }
  .site-header { view-transition-name: site-navigation; }
  ::view-transition-old(root) { animation: page-out .16s ease-in both; }
  ::view-transition-new(root) { animation: page-in .28s ease-out both; }
  ::view-transition-group(site-navigation) { animation-duration: .22s; }
  .hero-content > *, .hero-inner > .portrait-frame, .page-hero > :first-child {
    animation: content-in .48s cubic-bezier(.18, .75, .3, 1) var(--entry-delay, 0ms) backwards;
  }
  .hero-content > :nth-child(2) { --entry-delay: 45ms; }
  .hero-content > :nth-child(3) { --entry-delay: 85ms; }
  .hero-content > :nth-child(4) { --entry-delay: 125ms; }
  .hero-content > :nth-child(5) { --entry-delay: 165ms; }
}

@keyframes page-out { to { opacity: 0; } }
@keyframes page-in { from { opacity: 0; } }
@keyframes ambient-glow {
  from { opacity: .38; transform: translate(var(--ambient-offset), -4%) scale(.97); }
  45% { opacity: 1; }
}
@keyframes ambient-stars {
  from { opacity: .24; transform: translate(-.65rem, .6rem); }
}
@keyframes content-in {
  from { opacity: 0; transform: translateY(.85rem); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 54rem) {
  .header-inner { grid-template-columns: 1fr auto auto; min-height: 4.15rem; gap: .5rem; }
  .nav { grid-column: 1 / -1; flex-wrap: wrap; }
  .header-inner .search-link { grid-column: 3; grid-row: 1; }
  .menu-toggle { grid-column: 2; grid-row: 1; }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 46rem) {
  .home-hero, .page-hero { --ambient-offset: 3%; }
  .hero-inner, .about-hero .hero-inner { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .hero-content { justify-items: center; }
  .hero-content .actions, .hero-content .socials { justify-content: center; }
  .portrait-frame { width: min(57vw, 15rem); }
}

@media (max-width: 37rem) {
  .grid.three, .grid.two, .project-card, .filters, .contact-grid, .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .section-head { gap: .2rem 1rem; }
  .project-art { min-height: 11rem; border: 0; border-bottom: 1px solid var(--border); }
  .contact-callout { flex-direction: column; align-items: flex-start; }
  .contact-person img { height: clamp(13rem, 62vw, 21rem); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pending-reveal { opacity: 1; transform: none; }
  .revealed { transition: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}

@media (forced-colors: active) {
  .gradient { -webkit-text-fill-color: currentColor; background: none; }
  :is(.home-hero, .page-hero)::before,
  :is(.home-hero, .page-hero)::after { display: none; }
}
