﻿/* Foundations */
:root {
  color-scheme: dark;
  --bg: #13161a;
  --secondary: #1c2127;
  --text: #e8edf1;
  --muted: #a6b0b9;
  --accent: #92a7b5;
  --line: #343b42;
  --max: 1160px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.75 "Segoe UI",
    Arial,
    sans-serif;
}
::selection {
  background: #455b6d;
  color: white;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a,
button {
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 550;
}
h2 {
  font-size: 32px;
  letter-spacing: -1px;
}
p + p {
  margin-top: 18px;
}
.muted,
.status {
  color: var(--muted);
}
.mono,
.eyebrow {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}
.section {
  max-width: var(--max);
  padding: 80px 40px;
  margin: auto;
}
[hidden] {
  display: none !important;
}

/* Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  height: 80px;
  padding: 0 max(40px, calc((100vw - 1080px) / 2));
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.header.scrolled {
  border-bottom-color: var(--line);
}
.brand {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.8px;
}
.brand span {
  color: var(--accent);
}
nav {
  display: flex;
  align-items: center;
  gap: 25px;
}
nav a {
  position: relative;
  padding: 10px 0;
  font-size: 13px;
  color: var(--muted);
}
nav a::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s;
}
nav a:hover,
nav a.active {
  color: var(--text);
}
nav a:hover::after,
nav a.active::after {
  transform: scaleX(1);
}
.menu-toggle {
  display: none;
}

/* Introduction: personal text and a useful project index */
.hero {
  display: grid;
  grid-template-columns: 1fr 245px;
  align-items: end;
  gap: 80px;
  padding-top: 100px;
  padding-bottom: 100px;
}
.hero .eyebrow {
  color: var(--accent);
  margin-bottom: 28px;
}
h1 {
  font-size: clamp(40px, 4.7vw, 62px);
  letter-spacing: -2.5px;
  line-height: 1.12;
  margin-bottom: 30px;
}
h1 span {
  color: var(--accent);
}
.hero-description {
  max-width: 570px;
  font-size: 17px;
  color: #c2cad0;
}
.project-index {
  padding-bottom: 5px;
}
.project-index > p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 18px;
}
.project-index a {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 0.2s;
}
.project-index a:hover {
  padding-left: 8px;
}
.project-index a span {
  font-size: 17px;
}
.project-index small {
  color: var(--muted);
  font-size: 12px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.button {
  display: inline-flex;
  padding: 10px 18px;
  border: 1px solid #607685;
  border-radius: 3px;
  font-size: 13px;
  transition:
    background 0.2s,
    transform 0.2s;
}
.primary {
  background: #b4c5d0;
  color: #101318;
  border-color: #b4c5d0;
}
.primary:hover {
  background: #d1dce3;
  transform: translateY(-2px);
}
.text-link {
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: #607685;
  text-underline-offset: 5px;
}
.text-link:hover {
  text-decoration-color: var(--text);
}

/* About */
.about {
  border-top: 1px solid var(--line);
}
.about-layout {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 80px;
}
.about h2 {
  font-size: 25px;
}
.about-copy {
  max-width: 660px;
  color: var(--muted);
  font-size: 15px;
}
.about-copy p:first-child {
  color: #ccd3d9;
  font-size: 18px;
}

/* Project studies */
.projects {
  padding-top: 75px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 28px;
}
.section-heading > p {
  max-width: 400px;
  color: var(--muted);
  font-size: 14px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 30px 0 10px;
  border-bottom: 1px solid var(--line);
}
.filters button {
  position: relative;
  background: transparent;
  border: 0;
  padding: 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.filters button::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.filters button.active {
  color: var(--text);
}
.filters button.active::after {
  transform: scaleX(1);
}
.filters button:hover {
  color: var(--text);
}
.project-card {
  scroll-margin-top: 110px;
  animation: enter 0.35s both;
}
.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 65px;
  padding: 55px 0;
  border-bottom: 1px solid var(--line);
}
.project-meta {
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 12px;
}
.project-body h3 {
  font-size: 34px;
  letter-spacing: -1px;
}
.project-summary {
  margin-top: 20px;
  color: #c2cbd2;
  font-size: 15px;
}
.implementation-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 24px;
}
.implementation-note > span {
  display: block;
  color: var(--text);
  font-size: 12px;
  margin-bottom: 6px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 22px;
}
.tags span {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
}
.project-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
}
.status {
  font-size: 12px;
}
.detail-button {
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #607685;
  background: transparent;
  padding: 8px 0;
  font-size: 13px;
  white-space: nowrap;
}
.detail-button span {
  display: inline-block;
  padding-left: 12px;
  transition: transform 0.2s;
}
.detail-button:hover span {
  transform: translate(2px, -2px);
}
.project-visual {
  background: var(--secondary);
  border: 1px solid var(--line);
  padding: 30px;
  border-radius: 3px;
}
.project-visual figcaption {
  font-size: 13px;
  color: #c4cdd4;
  margin-bottom: 25px;
}
.project-visual > p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 24px;
}
.project-visual img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 16px;
}
.ritual-diagram ol {
  padding: 0;
  margin: 0;
  list-style: none;
}
.ritual-diagram li {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.ritual-diagram li > span {
  font-family: Consolas, monospace;
  font-size: 11px;
  color: var(--accent);
}
.project-chestcount .project-visual {
  grid-column: 1;
  grid-row: 1;
  padding: 28px 24px;
}
.project-chestcount .project-body {
  grid-column: 2;
  grid-row: 1;
}
.sync-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 0;
}
.sync-flow > span {
  font-size: 14px;
}
.sync-flow small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.sync-flow b {
  color: var(--accent);
  font-weight: 400;
}
.project-soulsbell {
  display: block;
  padding-left: 36px;
  border-left: 2px solid #888e81;
  margin-top: 36px;
  padding-top: 15px;
  padding-bottom: 35px;
}
.project-soulsbell .project-body {
  max-width: 740px;
}
.project-soulsbell h3 {
  font:
    44px/1.2 Georgia,
    serif;
  letter-spacing: -1.5px;
}
.project-soulsbell .project-meta {
  color: #b0b7a8;
}
.other-heading {
  margin: 60px 0 28px;
}
.other-heading h3 {
  font-size: 21px;
  font-weight: 500;
}
.compact {
  display: block;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.compact .project-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  column-gap: 45px;
}
.compact h3 {
  grid-column: 1;
  font-size: 22px;
}
.compact .project-meta {
  grid-column: 1;
  font-size: 11px;
  margin-bottom: 8px;
}
.compact .project-summary {
  grid-column: 2;
  grid-row: 1 / 4;
  margin: 0;
  font-size: 14px;
}
.compact .tags {
  grid-column: 2;
  margin-top: 12px;
}
.compact .project-bottom {
  grid-column: 1 / -1;
  margin-top: 15px;
}

/* Skills and education */
.skills {
  border-top: 1px solid var(--line);
}
.skills h2 {
  max-width: 430px;
}
.skill-grid {
  margin-top: 35px;
}
.skill-group {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 80px;
  border-top: 1px solid var(--line);
  padding: 25px 0;
}
.skill-group h3 {
  font-size: 15px;
  font-weight: 500;
}
.skill-group .tags {
  margin: 0;
  gap: 10px 23px;
}
.skill-group .tags span {
  font-family: inherit;
  font-size: 14px;
}
.journey-layout {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 80px;
}
.journey-layout > div > p {
  margin-top: 20px;
  font-size: 14px;
}
.timeline {
  border-left: 1px solid var(--line);
}
.timeline-item {
  position: relative;
  padding: 0 0 32px 30px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item .mono {
  font-family: inherit;
  font-size: 12px;
}
.timeline-item h3 {
  margin: 6px 0 10px;
  font-size: 19px;
}
.timeline-item p {
  color: var(--muted);
  font-size: 14px;
  max-width: 550px;
}

/* Contact and footer */
.contact {
  display: grid;
  grid-template-columns: 245px 1fr;
  gap: 80px;
  border-top: 1px solid var(--line);
}
.contact-content {
  max-width: 570px;
  color: #c2cad0;
}
.contact .actions {
  margin-top: 22px;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  max-width: 1080px;
  padding: 28px 0;
  margin: auto;
  border-top: 1px solid var(--line);
}
footer > span {
  font-size: 11px;
  color: var(--muted);
}
footer > div {
  display: flex;
  gap: 22px;
  font-size: 12px;
}
footer a:hover {
  color: var(--accent);
}

/* Details and accessibility */
dialog {
  background: var(--secondary);
  color: var(--text);
  border: 1px solid #49545d;
  border-radius: 5px;
  width: min(700px, calc(100% - 32px));
  max-height: 85dvh;
  padding: 32px;
}
dialog::backdrop {
  background: #080b10d9;
}
body:has(dialog[open]) {
  overflow: hidden;
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dialog-close {
  background: transparent;
  border: 1px solid var(--line);
  width: 40px;
  height: 40px;
  border-radius: 3px;
}
.dialog-close:hover {
  background: #29313a;
}
dialog h2 {
  margin: 12px 0;
}
dialog h3 {
  font-size: 16px;
  margin: 26px 0 10px;
}
dialog p,
dialog li {
  color: #bdc7cf;
  font-size: 14px;
}
dialog .status {
  margin-bottom: 22px;
  font-size: 12px;
}
dialog ul {
  padding-left: 20px;
}
dialog li {
  margin: 7px 0;
}
.planned {
  border-left: 2px solid var(--accent);
  padding: 1px 20px 8px;
  margin-top: 25px;
}
.planned h3 {
  color: var(--accent);
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: var(--text);
  color: var(--bg);
  padding: 10px;
  z-index: 100;
}
.skip-link:focus {
  top: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Direct feedback: no continuous animation or layout changes. */
.ritual-diagram li { transition: color .2s, transform .2s; }
.ritual-diagram li:hover { color: var(--accent); transform: translateX(4px); }
dialog[open] { animation: enter .2s ease-out; }
.project-card:target h3 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 8px; text-decoration-thickness: 1px; }

/* Motion: entrances and direct interaction feedback only */
.will-reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.5s,
    transform 0.5s;
}
.will-reveal.visible {
  opacity: 1;
  transform: none;
}
.hero-copy > * {
  animation: enter 0.6s both;
}
.hero-copy > *:nth-child(2) {
  animation-delay: 0.08s;
}
.hero-copy > *:nth-child(3) {
  animation-delay: 0.16s;
}
.hero-copy > *:nth-child(4) {
  animation-delay: 0.24s;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Tablet and mobile */
@media (max-width: 1100px) {
  .hero,
  .about-layout,
  .journey-layout,
  .contact,
  .skill-group {
    gap: 40px;
  }
  .hero {
    grid-template-columns: 1fr 210px;
  }
  .featured {
    gap: 35px;
  }
  footer {
    margin-inline: 40px;
  }
  nav {
    gap: 18px;
  }
}
@media (max-width: 999px) {
  .menu-toggle {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px 0 10px 15px;
    background: transparent;
    border: 0;
    font-size: 13px;
  }
  .header {
    height: 70px;
  }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 16px 40px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  nav.open {
    display: flex;
    animation: enter 0.2s;
  }
  nav a {
    font-size: 15px;
    padding: 12px 0;
  }
  nav a::after {
    right: auto;
    width: 25px;
  }
  .hero {
    gap: 35px;
  }
  h1 {
    font-size: 44px;
  }
  .hero-description {
    font-size: 16px;
  }
  .about-layout,
  .journey-layout,
  .contact,
  .skill-group {
    grid-template-columns: 190px 1fr;
    gap: 35px;
  }
  .featured {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .project-visual {
    max-width: 560px;
  }
  .project-chestcount .project-body,
  .project-chestcount .project-visual {
    grid-column: auto;
    grid-row: auto;
  }
  .project-chestcount .project-visual {
    order: 2;
  }
  .compact .project-body {
    grid-template-columns: 190px 1fr;
    gap: 0 30px;
  }
  .section-heading {
    align-items: start;
  }
  .section-heading > p {
    max-width: 280px;
  }
  footer {
    flex-wrap: wrap;
  }
  footer > span {
    width: 100%;
    order: 3;
  }
}
@media (max-width: 650px) {
  .section {
    padding: 54px 24px;
  }
  .header {
    padding-inline: 24px;
    height: 64px;
  }
  nav {
    padding-inline: 24px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 45px;
    padding-top: 55px;
  }
  h1 {
    font-size: clamp(32px, 8.8vw, 49px);
    letter-spacing: -1.5px;
  }
  h2 {
    font-size: 28px;
  }
  .hero .eyebrow {
    font-size: 11px;
    margin-bottom: 24px;
  }
  .hero-description {
    font-size: 16px;
  }
  .project-index {
    display: grid;
    grid-template-columns: 1fr;
  }
  .project-index > p {
    margin-bottom: 8px;
  }
  .project-index a {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
  }
  .project-index a span {
    font-size: 15px;
  }
  .project-index small {
    font-size: 11px;
  }
  .about-layout,
  .journey-layout,
  .contact,
  .skill-group {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .about-copy p:first-child {
    font-size: 17px;
  }
  .section-heading {
    display: block;
  }
  .section-heading > p {
    max-width: none;
    margin-top: 18px;
  }
  .section-heading br {
    display: none;
  }
  .filters {
    gap: 0 20px;
    margin-top: 23px;
  }
  .filters button {
    font-size: 12px;
  }
  .featured {
    padding: 35px 0;
  }
  .project-body h3 {
    font-size: 29px;
  }
  .project-summary {
    font-size: 15px;
    margin-top: 16px;
  }
  .project-bottom {
    align-items: start;
    gap: 15px;
  }
  .status {
    font-size: 11px;
  }
  .detail-button {
  min-height: 44px;
    font-size: 12px;
  }
  .project-visual {
    padding: 24px;
  }
  .sync-flow {
    gap: 5px;
  }
  .sync-flow > span {
    font-size: 12px;
  }
  .sync-flow small {
    font-size: 9px;
  }
  .project-chestcount .project-visual {
    padding: 24px 18px;
  }
  .project-soulsbell {
    padding: 5px 0 30px 22px;
    margin-top: 28px;
  }
  .project-soulsbell h3 {
    font-size: 36px;
  }
  .other-heading {
    margin-top: 42px;
  }
  .compact .project-body {
    display: block;
  }
  .compact .project-body h3 {
    font-size: 23px;
  }
  .compact .project-summary {
    margin-top: 16px;
  }
  .compact .tags {
    margin-top: 18px;
  }
  .skill-group {
    gap: 15px;
    padding: 24px 0;
  }
  .timeline {
    margin-left: 3px;
  }
  .timeline-item {
    padding-left: 24px;
  }
  .journey-layout > div > p {
    margin-top: 16px;
  }
  footer {
    margin-inline: 24px;
    gap: 20px;
  }
  footer > div {
    gap: 18px;
  }
  footer > span {
    font-size: 10px;
  }
  dialog {
    padding: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .will-reveal {
    opacity: 1;
    transform: none;
  }
}
