:root {
  --bg: #faf8f3;
  --ink: #221f1a;
  --muted: #6e675c;
  --accent: var(--accent-user, #0f8a7d);
  --on-accent: var(--on-accent-user, var(--bg));
  --line: #e6e1d6;
  --line-strong: #c9c2b2;
  --card: #f2eee5;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-soft: cubic-bezier(0.3, 1.06, 0.4, 1);
  --morph: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171511;
    --ink: #eae5da;
    --muted: #a09a8d;
    --accent: var(--accent-user-dark, #56d9cf);
    --on-accent: var(--on-accent-user-dark, var(--bg));
    --line: #2e2b25;
    --line-strong: #4a453c;
    --card: #201d18;
  }
}

:root[data-theme="dark"] {
  --bg: #171511;
  --ink: #eae5da;
  --muted: #a09a8d;
  --accent: var(--accent-user-dark, #56d9cf);
  --on-accent: var(--on-accent-user-dark, var(--bg));
  --line: #2e2b25;
  --line-strong: #4a453c;
  --card: #201d18;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  padding-inline: clamp(1.5rem, 7vw, 5rem);
}

.skip {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  transition: top 0.15s ease;
}

.skip:focus {
  top: 1rem;
}

.hero {
  padding: 4.5rem 0 4rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4.5rem;
}

.top a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.3s var(--spring);
}

.top a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--card);
  transform: translateY(-1px);
}

.lang-switch {
  position: relative;
}

.lang-btn {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
}

.lang-btn::after {
  content: "";
  width: 0.32rem;
  height: 0.32rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-12%);
}

.lang-switch:hover .lang-btn,
.lang-switch:focus-within .lang-btn {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--card);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 7rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(23, 21, 17, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.2s var(--spring-soft), visibility 0s linear 0.15s;
}

.lang-switch:hover .lang-menu,
.lang-switch:focus-within .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.lang-menu a {
  display: block;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-menu a:hover {
  color: var(--accent);
  background: var(--card);
}

.lang-menu a[aria-current="page"] {
  color: var(--on-accent);
  background: var(--accent);
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  overflow: hidden;
}

.theme-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  background: var(--accent);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s var(--spring-soft), width 0.4s var(--spring-soft);
}

.theme-opt {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.theme-opt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-opt.is-active {
  color: var(--on-accent);
}

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}

h1 .i-wrap {
  position: relative;
  display: inline-block;
}

h1 .i-tittle {
  position: absolute;
  top: 0.165em;
  left: 50%;
  width: 0.155em;
  height: 0.155em;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
  transition: background 0.2s ease, opacity 0.15s ease;
}

h1:hover .i-tittle {
  background: var(--accent);
}

.banner {
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 0.5rem 1rem;
}

.version {
  display: inline-block;
  font-family: var(--mono);
  font-size: clamp(0.55rem, 1.4vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5em 0.9em;
  vertical-align: top;
  margin-left: 0.4em;
}

.lede {
  font-size: 1.28rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 36rem;
}

.coords {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: 2.4rem;
}

.langs {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.langs .flag {
  display: block;
  width: 21px;
  height: 14px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--line);
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}

.hero-photo {
  margin: 0;
  flex-shrink: 0;
  width: clamp(200px, 26vw, 360px);
}

.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 28px;
  border: 1px solid var(--line);
  transition: border-radius 0.4s var(--spring-soft);
  animation: photo-in 1.2s var(--spring-soft) backwards 0.15s;
}

.hero-photo img:hover {
  border-radius: 16px;
}

.hero-photo figcaption {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
  animation: caption-in 0.6s ease-out backwards 0.55s;
}

.photo-credit {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.photo-credit a {
  color: inherit;
}

@keyframes caption-in {
  from {
    opacity: 0;
  }
}

@keyframes photo-in {
  from {
    opacity: 0;
    transform: translateY(14px);
    border-radius: 160px;
  }
}

@media (max-width: 700px) {
  .hero-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2.2rem;
  }

  .hero-photo {
    width: 210px;
  }
}

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line-strong);
  scroll-margin-top: 2rem;
}

.label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.6rem;
}

.section p + p {
  margin-top: 1rem;
}

.section > p,
.about-prose p {
  max-width: 40rem;
}

@media (min-width: 1000px) {
  .section {
    padding: 5rem 0;
  }
}

.roadmap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 2.25rem 2rem;
  margin-top: 4rem;
}

.roadmap h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

.roadmap .lane + .lane {
  margin-top: 2.2rem;
}

.roadmap .lane-fill {
  display: none;
}

.roadmap .lane-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.roadmap ul {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  display: grid;
  gap: 0.95rem;
}

.roadmap ul::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

.roadmap li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  transition: color 0.2s ease;
}

.roadmap li:hover {
  color: var(--ink);
}

.roadmap li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--accent);
  transition: transform 0.3s var(--spring);
}

.roadmap li:hover::after {
  transform: scale(1.3);
}

.roadmap li.next::after {
  width: 11px;
  height: 11px;
  top: 7px;
  background: var(--bg);
  border: 1.5px solid var(--accent);
}

.roadmap .year {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.15rem;
}

@media (min-width: 900px) {
  .roadmap ul {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 1.5rem;
  }

  .roadmap ul::before {
    left: 6px;
    right: 8px;
    top: 6px;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .roadmap li {
    padding-left: 0;
    padding-right: 1.4rem;
    padding-top: 1.7rem;
  }

  .roadmap li::after {
    top: 0;
  }

  .roadmap li.next::after {
    top: 1px;
  }

  .roadmap .lane-fill {
    display: block;
    position: absolute;
    top: 5px;
    left: 6px;
    height: 2px;
    background: var(--accent);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.8s cubic-bezier(0.65, 0, 0.35, 1);
    pointer-events: none;
  }

  .roadmap .is-drawn .lane-fill {
    transform: scaleX(1);
  }

  .roadmap .lane-past li::after {
    background: var(--line);
    transition: background-color 0.45s ease var(--d, 0s), transform 0.3s var(--spring);
  }

  .roadmap .lane-past ul.is-drawn li::after {
    background: var(--accent);
  }
}

.projects {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 480px));
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.8rem;
}

.project {
  padding: 1.15rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-radius 0.35s var(--spring);
}

.project:hover {
  border-radius: 40px;
}

.project h3 {
  font-size: 1.12rem;
  line-height: 1.3;
}

.project h3 a {
  text-decoration: none;
}

.project h3 a:hover {
  color: var(--accent);
}

.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.project .tag {
  margin: 0.25rem 0 0.45rem;
}

.project p:last-child {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.mini {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 480px));
  justify-content: space-between;
  gap: 0.5rem 2.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.section-head .label {
  margin-bottom: 0;
}

.gear {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin-top: 1.8rem;
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery figure {
  margin: 0;
}

.gallery a {
  display: block;
  border-radius: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-radius 0.4s var(--spring);
}

.gallery a:hover {
  border-radius: 16px;
}

.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.gallery figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 0.45rem;
}

.email {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 16px;
  padding: 0.75em 1.5em;
  margin: 0.6rem 0 1.8rem;
  transition: border-radius 0.4s var(--spring);
}

.email:hover {
  border-radius: 34px;
}

.email:active {
  border-radius: 10px;
}

.links {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem 2.5rem;
  font-size: 0.98rem;
}

#toolbox .links {
  margin-top: 0.9rem;
  grid-template-columns: 1fr;
  max-width: 40rem;
}

#toolbox .links .tag {
  min-width: 8rem;
}

#toolbox .hero-photo img {
  aspect-ratio: 3 / 4;
}

.sub-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2.4rem 0 0;
}

@media (min-width: 640px) {
  .links {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .links {
    grid-template-columns: repeat(3, 1fr);
  }
}

.links li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.6rem;
}

.links .tag {
  min-width: 7rem;
  flex-shrink: 0;
}

.colour-modal {
  margin: auto;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 2.2rem 2.4rem 2rem;
  max-width: min(92vw, 26rem);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.colour-modal::backdrop {
  background: rgba(23, 21, 17, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.colour-modal[open] {
  animation: modal-in 0.55s var(--spring-soft) backwards;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
    border-radius: 90px;
  }
}

.colour-modal .colour-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.colour-modal h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.2;
  margin: 0.6rem 0 0.7rem;
}

.colour-modal p {
  font-size: 0.98rem;
  color: var(--muted);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 1.7rem;
}

.swatch {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 19px;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
  transition: border-radius 0.35s var(--spring), border-color 0.2s ease;
}

.swatch:hover {
  border-radius: 12px;
  border-color: var(--ink);
}

.swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.swatch-custom {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 19px;
  border: 2px dashed var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1;
  transition: border-radius 0.35s var(--spring), border-color 0.2s ease, color 0.2s ease;
}

.swatch-custom:hover {
  border-radius: 12px;
  border-color: var(--ink);
  color: var(--ink);
}

.swatch-custom input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.colour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.colour-note {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.colour-skip {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  padding: 0.5rem 1.2rem;
  border-radius: 34px;
  cursor: pointer;
  transition: border-radius 0.35s var(--spring), color 0.2s ease, border-color 0.2s ease;
}

.colour-skip:hover {
  border-radius: 12px;
  color: var(--accent);
  border-color: var(--accent);
}

.colour-skip:focus-visible,
.repaint:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.repaint {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: border-radius 0.35s var(--spring), filter 0.2s ease;
}

.repaint:hover {
  border-radius: 18px;
  filter: brightness(1.08);
}

.repaint:active {
  border-radius: 6px;
  filter: brightness(0.9);
}

.hosted {
  display: block;
  margin-top: 3.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--line-strong);
  margin-top: 1.2rem;
  padding: 2rem 0 3rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hosted a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.hosted a:hover {
  color: var(--accent);
}

@media (max-width: 560px) {
  .hero {
    padding-top: 3rem;
  }

  .top {
    margin-bottom: 3rem;
    gap: 1rem;
  }
}

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

  h1 .i-tittle {
    animation: none !important;
  }

  * {
    transition: none !important;
  }

  .hero-photo img,
  .hero-photo figcaption {
    animation: none !important;
  }

  .colour-modal[open] {
    animation: none !important;
  }

  .hero-photo .halo {
    animation: none !important;
  }
}

@property --a {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.hero-photo .frame {
  display: block;
  position: relative;
}

.hero-photo .halo {
  position: absolute;
  inset: -7px;
  z-index: 0;
  background: conic-gradient(
    from var(--a),
    color-mix(in oklab, var(--accent), white 55%) 0deg,
    color-mix(in oklab, var(--accent), white 55%) 40deg,
    var(--accent) 80deg,
    color-mix(in oklab, var(--accent), white 55%) 120deg,
    color-mix(in oklab, var(--accent), white 55%) 160deg,
    var(--accent) 200deg,
    color-mix(in oklab, var(--accent), white 55%) 240deg,
    color-mix(in oklab, var(--accent), white 55%) 280deg,
    var(--accent) 320deg,
    color-mix(in oklab, var(--accent), white 55%) 360deg
  );
  border-radius: 35px;
  transition: border-radius 0.4s var(--spring-soft);
  animation:
    halo-spin 8s linear infinite,
    halo-in 0.7s ease-out backwards 1.1s;
}

.hero-photo .frame:hover .halo {
  border-radius: 23px;
}

@keyframes halo-spin {
  to {
    --a: 360deg;
  }
}

@keyframes halo-in {
  from {
    opacity: 0;
  }
}

.hero-photo .frame img {
  position: relative;
  z-index: 1;
}
