@font-face {
  font-family: Inter;
  src: url("assets/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --panel: #121212;
  --card: #181818;
  --card-hover: #222;
  --line: #2c2c2c;
  --line-strong: #414141;
  --text: #f4f4f4;
  --text-secondary: #c8c8c8;
  --text-muted: #a3a3a3;
  --accent: #ffa657;
  --button: #ffa657;
  --button-text: #201207;
  --copper: #b57958;
  --shadow: 0 1px 0 rgb(255 255 255 / 3%) inset, 0 20px 40px -24px rgb(0 0 0 / 80%);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eee;
  --panel: #f7f7f7;
  --card: #fff;
  --card-hover: #f1f1f1;
  --line: #dedede;
  --line-strong: #c6c6c6;
  --text: #181818;
  --text-secondary: #454545;
  --text-muted: #626262;
  --accent: #a4470a;
  --copper: #8e563b;
  --shadow: 0 1px 2px rgb(0 0 0 / 4%), 0 18px 36px -24px rgb(0 0 0 / 25%);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

[data-theme="dark"] body {
  background-image: radial-gradient(ellipse 100% 75% at 50% 100%, rgb(255 166 87 / 13%), transparent 82%);
  background-attachment: fixed;
}

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--button-text); background: var(--button); }

.home-page {
  -webkit-user-select: none;
  user-select: none;
}

.shell {
  width: min(70rem, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.header-inner, .brand, .nav, .project-identity {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: 4.5rem;
  justify-content: space-between;
  gap: .75rem;
}

.brand {
  gap: .625rem;
  font-size: 1.1875rem;
  font-weight: 730;
  letter-spacing: -.035em;
  text-decoration: none;
}

.brand img, .project-identity img { flex: none; }
.nav { gap: .75rem; }

.nav-link, .theme-button {
  min-height: 2.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--panel);
  font: 600 .875rem/1.2 Inter, system-ui, sans-serif;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding-inline: .875rem;
  text-decoration: none;
}

.theme-button {
  width: 2.5rem;
  padding: 0;
  cursor: pointer;
}

.theme-button:not([hidden]) { display: grid; place-items: center; }

.nav-link:hover, .theme-button:hover {
  color: var(--text);
  background: var(--card-hover);
}

.theme-icon {
  width: 1.15rem;
  height: 1.15rem;
  background: currentColor;
  border-radius: 50%;
  mask-image: radial-gradient(circle at 76% 27%, transparent 0 39%, #000 44%);
}

[data-theme="light"] .theme-icon {
  mask-image: none;
  background: none;
  border: 2px solid;
}

.intro { padding-block: clamp(3rem, 9vw, 6.75rem) clamp(2.5rem, 6vw, 4.5rem); }

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
}

.intro-logo {
  grid-area: 1 / 2;
  display: block;
  width: clamp(8rem, 17vw, 12rem);
  height: auto;
  justify-self: center;
}

@media (max-width: 40rem) {
  .home-intro { grid-template-columns: minmax(0, 1fr); }
  .intro-logo { grid-area: auto; justify-self: start; width: 7rem; }
}

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: clamp(2.625rem, 7vw, 5rem);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -.065em;
  text-wrap: balance;
}

h1 span[aria-hidden] { color: var(--accent); }

.intro p {
  max-width: 35rem;
  margin-top: 1.125rem;
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.1875rem);
  text-wrap: pretty;
}

.projects {
  padding-bottom: clamp(3rem, 7vw, 6rem);
  scroll-margin-top: 1.25rem;
}

h2 {
  margin-bottom: 1rem;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project {
  display: grid;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--copper) 38%, var(--line));
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.project + .project { margin-top: 1rem; }

.project-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.project-identity { gap: .875rem; }

h3 {
  font-size: clamp(1.625rem, 3.5vw, 2.125rem);
  font-weight: 720;
  letter-spacing: -.045em;
  line-height: 1.1;
}

.project-path {
  margin-top: .3rem;
  color: var(--text-muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}

.project-description {
  margin-top: 1.375rem;
  color: var(--text-secondary);
  text-wrap: pretty;
  max-width: 43rem;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: .25rem .5rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: .875rem;
  color: var(--text-secondary);
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  margin-top: 1.75rem;
  padding: .5rem 1rem;
  border-radius: 8px;
  color: var(--button-text);
  background: var(--button);
  font-size: .9375rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.project-link:hover { box-shadow: 0 0 0 2px rgb(255 166 87 / 40%); }

@media (max-width: 28rem) {
  .shell { width: calc(100% - 2rem); }
  .nav { gap: .5rem; }
  .nav-link { padding-inline: .625rem; }
  .project-content { padding: 1.25rem; }
}

.site-header, main { position: relative; }
.site-header { z-index: 1; }
.brand img { width: 44px; height: 44px; }
.nav-link[aria-current] { color: var(--accent); }

.language-select {
  min-height: 2.5rem;
  padding-inline: .5rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-secondary);
  font: 600 .875rem/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse at 85% 20%, rgb(255 166 87 / 10%), transparent 55%);
}

.ambient::before {
  content: "";
  position: absolute;
  inset: -48px;
  background-image: linear-gradient(to right, rgb(181 121 88 / 22%) 1px, transparent 1px),
                    linear-gradient(to bottom, rgb(181 121 88 / 22%) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 82% 37%, black 5%, transparent 65%);
  animation: drift-grid 12s linear infinite;
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 32% 22% at 77% 31%, rgb(255 166 87 / 24%), transparent);
  animation: drift-light 12s ease-in-out infinite alternate;
}

@keyframes drift-grid { to { transform: translate(48px, 48px); } }
@keyframes drift-light { to { transform: translate(9%, 16%); opacity: .45; } }

@media (prefers-reduced-motion: reduce) {
  .ambient::before, .ambient::after { animation: none; }
}

.contact { padding-block: 2rem 4rem; }
.contact a { color: var(--accent); }

@media (max-width: 39rem) {
  .header-inner { flex-wrap: wrap; gap: .5rem; padding-block: .625rem; }
  .nav { flex-wrap: wrap; gap: .375rem; }
  .nav-link { padding-inline: .5rem; }
}
