:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f2f4ed;
  background: #111412;
  --ink: #f2f4ed;
  --muted: #aab5ad;
  --panel: #191e1a;
  --line: #38463e;
  --control-line: #687b6c;
  --accent: #dbfa83;
  --accent-ink: #1b2510;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.wrap { width: min(1352px, calc(100% - 6rem)); margin-inline: auto; }
h1, h2, h3, h4, p, dd { margin: 0; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.8rem);
  min-height: 4.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 1.55rem;
  aspect-ratio: 1;
  display: inline-block;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 42%, 50% 42%, 50% 100%, 0 100%);
}
nav { display: flex; align-items: center; gap: clamp(.8rem, 3vw, 2.2rem); font-size: .9rem; }
.header-inner nav { justify-content: flex-end; flex-wrap: wrap; }
nav a, footer a { text-decoration: none; }
nav a:hover, footer a:hover { color: var(--accent); }
.nav-contact { border: 1px solid var(--control-line); border-radius: .35rem; padding: .64rem .9rem; }
.languages { display: flex; flex-shrink: 0; padding: .2rem; border: 1px solid var(--control-line); border-radius: .45rem; gap: .15rem; }
.languages a { display: grid; place-items: center; min-height: 2rem; min-width: 2rem; border-radius: .25rem; font-size: .82rem; font-weight: 700; text-decoration: none; }
.languages a[aria-current] { background: var(--accent); color: var(--accent-ink); }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 10; padding: .7rem; background: var(--panel); transform: translateY(-150%); }
.skip:focus { transform: none; }

.intro {
  background:
    radial-gradient(ellipse at 77% 8%, #2b402d 0%, transparent 62%),
    #151c17;
  border-bottom: 1px solid var(--line);
}
.intro-inner {
  padding-block: clamp(3.5rem, 8.5vw, 8.5rem) clamp(3.5rem, 6.5vw, 6rem);
}
.kicker {
  font-family: Consolas, monospace;
  font-size: clamp(.73rem, 1.6vw, .875rem);
  letter-spacing: .08em;
  line-height: 1.55;
}
.kicker { color: var(--accent); margin-bottom: 1.35rem; }
h1 {
  font-size: clamp(3.5rem, 7vw, 7.25rem);
  letter-spacing: -.075em;
  line-height: .98;
  font-weight: 730;
}
h1 em { color: var(--accent); font-style: normal; }
.intro h1 {
  max-width: 23ch;
  font-size: clamp(2.45rem, 6.3vw, 5.45rem);
  line-height: 1.01;
  letter-spacing: -.062em;
}
.intro-description {
  margin-top: 1.2rem;
  max-width: 70ch;
  color: #c3cdc4;
  font-size: clamp(1rem, 1.7vw, 1.22rem);
  line-height: 1.58;
}
.primary {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  margin-top: 1.8rem;
  padding: .88rem 1.2rem;
  border-radius: .35rem;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 700;
}
.primary:hover { background: #efffc0; }
.intro-actions, .contact-actions { display: flex; align-items: center; gap: 1rem 1.25rem; flex-wrap: wrap; margin-top: 1.75rem; }
.intro-actions .primary { margin-top: 0; }
.secondary { display: inline-flex; padding: .83rem 1.15rem; border: 1px solid var(--control-line); border-radius: .35rem; text-decoration: none; font-weight: 650; }
.secondary:hover { border-color: var(--accent); color: var(--accent); }
.intro-secondary { color: var(--accent); font-weight: 650; text-underline-offset: .25em; }
.intro-secondary:hover { color: var(--ink); }
.impact { padding-top: clamp(2rem, 4vw, 4rem); }
.impact h2 { color: var(--muted); font-size: 1rem; letter-spacing: 0; }
.achievements {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--line);
  overflow: hidden;
}
.achievements li { display: grid; align-content: start; gap: .4rem; padding: clamp(1rem, 2.6vw, 2rem); background: #19231c; }
.achievements strong { color: var(--accent); font-size: clamp(1.85rem, 4vw, 3.1rem); line-height: 1.1; letter-spacing: -.045em; }
.achievements span { color: var(--ink); line-height: 1.42; }

.filters button, .reset-filter {
  border: 1px solid var(--control-line);
  border-radius: .35rem;
  background: transparent;
  padding: .55rem .78rem;
  min-height: 44px;
  color: var(--muted);
  font-size: .875rem;
}
.filters button:hover, .reset-filter:not(:disabled):hover { color: var(--ink); border-color: #889884; }
.reset-filter:disabled { opacity: .65; cursor: default; }
.filters button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.project-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.project-cta { color: var(--accent); font-size: .875rem; font-weight: 650; }
.project-link:hover .project-cta { text-decoration: underline; text-underline-offset: .25em; }

.projects { padding-block: clamp(2.5rem, 5vw, 5rem); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.text-link { color: var(--accent); text-underline-offset: .25em; font-size: .9rem; }
.text-link:hover { color: var(--ink); }
.section-description { margin-top: .7rem; max-width: 62ch; color: var(--muted); line-height: 1.6; }
h2 { font-size: clamp(1.8rem, 4vw, 3.3rem); letter-spacing: -.055em; line-height: 1.08; }
#result-count { font-size: .875rem; color: var(--muted); }
#result-count { white-space: nowrap; }
.project-filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-block: 1.4rem 1.6rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-actions { display: flex; align-items: end; flex-wrap: wrap; gap: .5rem; }
.technology-filter { display: grid; gap: .35rem; font-size: .875rem; color: var(--muted); }
.technology-filter select { min-height: 44px; padding: .5rem .7rem; border: 1px solid var(--control-line); border-radius: .35rem; background: var(--panel); color: var(--ink); font: inherit; }
.empty-results { padding: 1.15rem; border: 1px solid var(--line); color: var(--muted); }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.85rem, 2vw, 1.5rem); margin-top: 1.4rem; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.85rem, 2vw, 1.5rem); }
.project { display: flex; }
.project-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: .65rem;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .18s, transform .18s;
}
.project-link:hover { border-color: #a8bd76; transform: translateY(-3px); }
.project-image { position: relative; aspect-ratio: 1.65; background: #242e27; overflow: hidden; border-bottom: 1px solid var(--line); }
.project-image img { padding: .75rem; }
.image-note { position: absolute; bottom: .65rem; left: .65rem; padding: .25rem .45rem; border-radius: .25rem; background: #111412; color: var(--muted); font-size: .8125rem; }
.project-featured .project-link { border-color: #4b5d4e; }
.project-featured .project-link:hover { border-color: #a8bd76; }
.project-featured .project-image { aspect-ratio: 1.82; background: #213126; }
.project-featured .project-image img { padding: .48rem; }
.project-text { flex: 1; display: flex; flex-direction: column; align-items: start; padding: 1.1rem 1.2rem 1.25rem; gap: .55rem; }
.project-text h3 { font-size: clamp(1.15rem, 2.2vw, 1.55rem); line-height: 1.18; letter-spacing: -.035em; color: var(--ink); }
.project-featured .project-text h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
.category, .detail .category { font-size: .875rem; font-weight: 650; color: var(--accent); }
h3 { font-size: clamp(1.15rem, 2vw, 1.55rem); letter-spacing: -.035em; line-height: 1.2; }
.project-text p, .about p, .detail p, .detail li { color: var(--muted); line-height: 1.6; }
.project-cta { margin-top: auto; padding-top: .45rem; }
.technology-tags, .features .technology-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .38rem;
  padding: 0;
  margin: .35rem 0;
  list-style: none;
}
.technology-tags li, .features .technology-tags li {
  margin: 0;
  padding: .22rem .52rem;
  border: 1px solid var(--line);
  border-radius: .28rem;
  color: #c3cfc4;
  font-size: .8125rem;
  line-height: 1.35;
}
.detail .case-author { font-size: .875rem; margin-bottom: .75rem; }
.case-evidence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.tech-groups { display: grid; gap: .6rem; margin: .8rem 0 0; }
.tech-groups dt { font-weight: 650; }
.tech-groups dd { color: var(--muted); line-height: 1.55; margin-top: .12rem; }
.architecture {
  margin-top: 1.5rem;
  padding: clamp(1.05rem, 3vw, 1.7rem);
  background: #161e17;
  border: 1px solid #405343;
  border-radius: .65rem;
}
.architecture h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1.1rem; }
.architecture-path + .architecture-path { margin-top: 1rem; }
.architecture-path h3 { font-size: 1rem; margin-bottom: .45rem; }
.architecture-steps { display: flex; gap: 1.5rem; list-style: none; padding: 0; margin: 0; }
.architecture-steps li { position: relative; flex: 1; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: .35rem; background: var(--panel); }
.architecture-steps li + li::before { content: ''; position: absolute; left: -1.5rem; top: 50%; width: 1.5rem; border-top: 1px solid #749050; }
.detail .architecture-output { margin-top: 1rem; padding: .65rem .9rem; border-left: 2px solid var(--accent); }
.architecture-output strong { color: var(--accent); margin-right: .35rem; }
.about-content { display: grid; justify-items: start; gap: .85rem; }
.contact-email { color: var(--accent); overflow-wrap: anywhere; text-underline-offset: .25em; }
.about { border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(10rem, 1fr) 2fr; gap: 1.5rem; padding-block: 2.7rem; }
.about h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.about p { max-width: 65ch; }
.about .about-lead { color: var(--ink); font-size: 1.15rem; }
.workflow { display: flex; flex-wrap: wrap; gap: .55rem 1.4rem; list-style: none; margin: .4rem 0 0; padding: 0; }
.workflow li { position: relative; color: var(--ink); padding: .4rem .65rem; background: var(--panel); border: 1px solid var(--line); border-radius: .35rem; font-size: .9rem; }
.workflow li:not(:last-child)::after { content: '→' / ''; position: absolute; inset-inline-end: -1.2rem; color: var(--muted); }
.contact { padding-block: .8rem clamp(2rem, 5vw, 4rem); }
.contact-inner { padding: clamp(1.25rem, 4vw, 3rem); background: #19231c; border: 1px solid #4b5d4e; border-radius: .7rem; }
.contact-inner p { margin-top: .75rem; color: var(--muted); line-height: 1.55; }
.contact-email { font-weight: 650; }
footer { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-block: 1.5rem; color: var(--muted); font-size: .875rem; }

.detail { padding-block: 2rem 3.5rem; }
.detail .back { display: inline-block; margin-bottom: 2rem; color: var(--accent); text-underline-offset: .25em; }
.detail h1 { margin-block: .55rem 1rem; font-size: clamp(2.4rem, 6vw, 5.25rem); overflow-wrap: break-word; }
.detail .summary { max-width: 65ch; font-size: 1.13rem; }
.detail figure, .detail .features { margin: 0; padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: .65rem; }
.detail figure img { display: block; width: 100%; height: auto; max-height: 75vh; object-fit: contain; background: #101411; border-radius: .3rem; }
.detail figcaption { color: var(--muted); font-size: .875rem; padding-top: .75rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }
.detail figcaption a { color: var(--accent); }
.detail .features { padding: 1.2rem; }
.detail .features h2 { font-size: 1.35rem; letter-spacing: -.02em; }
.features ul { margin-bottom: 0; padding-left: 1.25rem; }
.features li + li { margin-top: .4rem; }
.features p { margin-top: .7rem; }
.detail .related { margin-top: 1.25rem; }
.card-metric strong, .related a { color: var(--accent); }
.case-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 16rem); align-items: end; gap: 1.4rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.case-header:not(:has(.case-metric)) { grid-template-columns: 1fr; }
.detail .case-metric { display: grid; gap: .45rem; padding: 1rem 1.3rem; align-self: end; background: #1d2719; border: 1px solid #445738; border-radius: .65rem; }
.case-metric strong { color: var(--accent); font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -.055em; }
.case-metric span { font-size: .95rem; }
.figure-link { display: block; border-radius: .3rem; }
.figure-link:hover img { filter: brightness(1.055); }
.case-next { border-top: 1px solid var(--line); margin-top: 2.75rem; padding-top: 1.3rem; }
.case-next .back { margin: 0; }
.case-next-link { margin-left: auto; display: grid; gap: .15rem; text-align: right; }
.case-next-link span { color: var(--muted); font-size: .875rem; }
.case-next-link strong { font-size: 1.125rem; }
.project-media { margin-top: 2.5rem; }
.project-media h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.gallery-grid figure:only-child { grid-column: 1 / -1; }
.gallery-grid figure:not(:only-child) img { aspect-ratio: 1.65; }
.gallery-dialog { width: min(96vw, 78rem); max-height: 94dvh; color: var(--ink); background: #111612; border: 1px solid var(--line); border-radius: .6rem; padding: .75rem; }
.gallery-dialog::backdrop { background: rgb(0 0 0 / .86); }
.detail .gallery-dialog img { height: min(66dvh, 52rem); }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .5rem 0; }
.gallery-toolbar button, .gallery-toolbar a { min-height: 2.75rem; display: inline-grid; place-items: center; padding: .55rem .7rem; border: 1px solid var(--control-line); border-radius: .3rem; background: var(--panel); color: var(--ink); font-size: .875rem; }
.gallery-toolbar button:hover, .gallery-toolbar a:hover { border-color: var(--accent); }
.gallery-count { color: var(--muted); }
.demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 23rem);
  align-items: center;
  gap: clamp(1.6rem, 6vw, 5rem);
  padding: clamp(1rem, 4vw, 3rem);
  border: 1px solid #405343;
  border-radius: .85rem;
  background: #19211b;
}
.demo-info .category { margin-bottom: .55rem; }
.demo-info > p { max-width: 55ch; }
.detail .video-demo { justify-self: center; width: min(100%, 20rem); padding: .55rem; background: #0c110e; }
.video-demo video { display: block; width: 100%; aspect-ratio: 6 / 13; background: #080d13; border-radius: .35rem; }
.video-demo figcaption { padding: .5rem .25rem .15rem; }
.chapters { list-style: none; padding: 0; margin: 1.4rem 0 0; border-top: 1px solid #435346; }
.chapters button {
  width: 100%;
  display: grid;
  grid-template-columns: 3.3rem 1fr;
  gap: .65rem;
  padding: .82rem .25rem;
  border: 0;
  border-bottom: 1px solid #435346;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.chapters button:hover, .chapters button:focus-visible { background: #293629; }
.chapter-time { color: var(--accent); font-variant-numeric: tabular-nums; }
.demo-status { font-size: .875rem; margin-top: .6rem; }
.demo-status:empty { margin-top: 0; }
.skills { background: #171d18; border-block: 1px solid var(--line); padding-block: clamp(2.4rem, 5vw, 4.3rem); }
.skills-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: .85rem;
  margin-top: 1.35rem;
}
.skill-card {
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: clamp(1rem, 2.7vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--panel);
}
.skill-card:nth-child(n + 5) { grid-column: span 4; }
.skill-card h3 { color: var(--ink); font-size: clamp(1.2rem, 2.2vw, 1.55rem); }
.skill-card p { color: var(--muted); line-height: 1.55; }
.skill-card .technology-tags { margin-bottom: 0; padding-top: .15rem; }
.skill-examples { display: flex; flex-wrap: wrap; gap: .45rem .8rem; margin-top: auto; padding-top: .65rem; font-size: .875rem; text-underline-offset: .2em; color: var(--accent); }
@media (max-width: 620px) {
  .architecture-steps { flex-direction: column; gap: .75rem; }
  .architecture-steps li + li::before {
    left: 50%;
    top: -.75rem;
    height: .75rem;
    width: 0;
    border-top: 0;
    border-right: 1px solid #749050;
  }
  .case-evidence, .case-header, .demo, .skills-grid, .gallery-grid, .featured-grid { grid-template-columns: 1fr; }
  .skills-grid .skill-card { grid-column: auto; }
}

@media (max-width: 1060px) {
  .wrap { width: calc(100% - 3rem); }
}
@media (max-width: 850px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: .55rem .75rem; padding-block: .65rem; }
  .header-inner nav { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; gap: .15rem clamp(.65rem, 3vw, 1.5rem); }
  .header-inner nav a { display: inline-flex; align-items: center; min-height: 2rem; }
  .nav-contact { border: 0; padding: 0; }
}
@media (max-width: 780px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 621px) and (max-width: 1020px) {
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills-grid .skill-card { grid-column: auto; }
  .skills-grid .skill-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 525px) {
  .wrap { width: calc(100% - 2rem); }
  nav { gap: .55rem; }
  .brand { font-size: 1rem; gap: .45rem; }
  .brand-mark { width: 1.15rem; }
  .header-inner nav { font-size: .8rem; }
  .project-grid, .about { grid-template-columns: 1fr; }
  .about { gap: .75rem; }
  h1 { font-size: clamp(3.05rem, 13vw, 4.1rem); }
  .featured .section-heading { align-items: flex-start; flex-direction: column; }
  .achievements { grid-template-columns: 1fr; }
  .achievements li { grid-template-columns: 6.25rem minmax(0, 1fr); align-items: baseline; column-gap: .7rem; }
  .achievements strong { font-size: 1.55rem; }
  .gallery-toolbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) {
  .intro-inner { animation: intro-in .38s ease-out both; }
  @keyframes intro-in {
    from { opacity: .85; transform: translateY(.5rem); }
    to { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-link { transition: none; }
  .project-link:hover { transform: none; }
}
