@font-face {
  font-family: "Roboto Flex";
  font-style: normal;
  font-display: swap;
  font-weight: 100 1000;
  src: url("fonts/roboto-flex-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("fonts/roboto-mono-latin.woff2") format("woff2");
}

:root {
  --font-sans: "Roboto Flex", "Roboto", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --brand-red: #c6423c;
  --brand-red-dark: #a9312c;
  --brand-yellow: #ffc72c;
  --panel-radius: 28px;
  --ease: cubic-bezier(0.05, 0.7, 0.1, 1);

  --surface: #f4efe6;
  --surface-low: #fffdfa;
  --surface-container: #ece3d6;
  --surface-high: #e6dac9;
  --surface-highest: #dcccb6;
  --on-surface: #2f241e;
  --on-surface-variant: #6b5a4d;
  --outline: #8d7868;
  --outline-variant: #d8cbbb;
  --panel-border: #e2d7c8;
  --primary: #a9241c;
  --on-primary: #fff8e8;
  --primary-container: #f9ddd6;
  --on-primary-container: #490b04;
  --secondary-container: #f6e6b4;
  --on-secondary-container: #3f2a00;
  --tertiary-container: #f8dda0;
  --on-tertiary-container: #3c2400;
  --inverse-surface: #2b160e;
  --inverse-on-surface: #fff3dc;
  --inverse-primary: #ffb4a5;

  --header-bg: rgba(255, 253, 249, 0.88);
  --header-bg-solid: rgba(255, 252, 246, 0.98);
  --hero-cta-bg: #c6423c;
  --hero-cta-fg: #fff9f1;
  --hero-cta-btn-bg: #f3cf74;
  --hero-cta-btn-fg: #3b2600;
  --location-bg: #f0d78f;
  --location-fg: #361d00;
  --location-muted: rgba(54, 29, 0, 0.66);
  --location-icon: #8f241b;
  --icon-red-bg: #f9e2dc;
  --icon-red-fg: #a3382d;
  --icon-yellow-bg: #f7edcc;
  --icon-yellow-fg: #7b5a16;
  --icon-amber-bg: #f4e4d3;
  --icon-amber-fg: #8f4c27;
  --toast-bg: #2f241e;
  --toast-fg: #fff6ea;
  --toast-action: #f3cf74;
  --backtop-bg: #f0cf6d;
  --backtop-fg: #2f241e;
  --progress: #a9241c;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1e1512;
  --surface-low: #291d18;
  --surface-container: #34241d;
  --surface-high: #3f2c23;
  --surface-highest: #4d372b;
  --on-surface: #f0e4d6;
  --on-surface-variant: #c9b29e;
  --outline: #8e7160;
  --outline-variant: #4d362b;
  --panel-border: #3a2921;
  --primary: #f0a08d;
  --on-primary: #4a0f07;
  --primary-container: #6a241b;
  --on-primary-container: #ffd9d1;
  --secondary-container: #44330c;
  --on-secondary-container: #f7dfa0;
  --tertiary-container: #51380c;
  --on-tertiary-container: #f5dda2;
  --inverse-surface: #f0e4d6;
  --inverse-on-surface: #291d18;
  --inverse-primary: #a9382e;
  --brand-red: #b8453f;
  --brand-red-dark: #a23833;

  --header-bg: rgba(30, 21, 18, 0.82);
  --header-bg-solid: rgba(35, 24, 20, 0.97);
  --hero-cta-bg: #e5c36d;
  --hero-cta-fg: #2a1c0a;
  --hero-cta-btn-bg: #b9423a;
  --hero-cta-btn-fg: #fff4e8;
  --location-bg: #6e2b24;
  --location-fg: #f7e9d9;
  --location-muted: rgba(247, 233, 217, 0.68);
  --location-icon: #e6c36d;
  --icon-red-bg: #48261f;
  --icon-red-fg: #f3a392;
  --icon-yellow-bg: #40320f;
  --icon-yellow-fg: #e9cd7c;
  --icon-amber-bg: #452d18;
  --icon-amber-fg: #e8b98b;
  --toast-bg: #34241d;
  --toast-fg: #f4e8da;
  --toast-action: #e7c675;
  --backtop-bg: #e2c06b;
  --backtop-fg: #2a1d12;
  --progress: #c15c52;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  min-width: 320px;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.015em;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

body.menu-open,
body.dialog-open {
  overflow: hidden;
}

::selection {
  background: var(--brand-red);
  color: #fff8e8;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

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

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-size: 0.875rem;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}

.icon [fill="currentColor"] {
  fill: currentColor;
  stroke: none;
}

.icon-solid {
  fill: currentColor;
  stroke: none;
}

.site-shell {
  min-height: 100svh;
  overflow-x: clip;
  background:
    radial-gradient(900px 480px at 92% -4%, rgba(245, 201, 74, 0.08), transparent 68%),
    var(--surface);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.wrap {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  padding-inline: 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 8px;
  z-index: 40;
  margin-top: 8px;
}

.header-bar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  backdrop-filter: blur(22px) saturate(1.4);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.site-header.is-scrolled .header-bar {
  background: var(--header-bg-solid);
  border-color: var(--outline-variant);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 2px;
  overflow: hidden;
  border-radius: 10px;
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-mark picture,
.avatar-wrap picture {
  display: contents;
}

.brand-name {
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 2px;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover {
  color: var(--on-surface);
}

.primary-nav a[aria-current="true"] {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.theme-switch {
  display: flex;
  align-items: center;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
}

.theme-switch button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--on-surface-variant);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-switch button:hover {
  color: var(--on-surface);
}

.theme-switch button[aria-pressed="true"] {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.theme-switch .icon {
  width: 20px;
  height: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s var(--ease);
}

.btn-brand {
  background: var(--brand-red);
  color: #fff8e8;
}

.btn-brand:hover {
  background: var(--brand-red-dark);
  transform: translateY(-1px);
}

.btn-tonal {
  width: 100%;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.btn-tonal:hover {
  filter: brightness(0.97);
}

.btn-ghost {
  border-color: var(--outline-variant);
  color: var(--primary);
}

.btn-ghost:hover {
  background: var(--surface-container);
}

.header-cta {
  display: none;
  height: 40px;
  flex-shrink: 0;
  padding-inline: 18px;
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 999px;
  color: var(--on-surface-variant);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-toggle:hover {
  background: var(--surface-container);
  color: var(--on-surface);
}

.menu-toggle .close-icon {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-icon {
  display: none;
}

.menu-toggle[aria-expanded="true"] .close-icon {
  display: block;
}

/* Shared */
.panel {
  background: var(--surface-low);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 10;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tooltip-top {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translate(-50%, -4px);
}

.tooltip-wrap:hover .tooltip,
.tooltip-wrap:has(:focus-visible) .tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--outline-variant);
  border-radius: 10px;
  color: var(--on-surface-variant);
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
}

.tag-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--brand-red);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--outline-variant);
  border-radius: 10px;
  color: var(--on-surface-variant);
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
}

.tag-sm {
  height: 24px;
  padding: 0 9px;
  font-size: 0.6875rem;
  border-radius: 8px;
}

.icon-bubble {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
}

.icon-bubble .icon {
  width: 20px;
  height: 20px;
}

.tone-red {
  background: var(--icon-red-bg);
  color: var(--icon-red-fg);
}

.tone-yellow {
  background: var(--icon-yellow-bg);
  color: var(--icon-yellow-fg);
}

.tone-amber {
  background: var(--icon-amber-bg);
  color: var(--icon-amber-fg);
}

.project-number {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0.035em;
  color: var(--on-surface-variant);
}

.muted {
  color: var(--on-surface-variant);
}

/* Hero */
.hero {
  padding-top: 12px;
}

.hero-grid {
  display: grid;
  gap: 12px;
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
  border-radius: 50%;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--surface-low);
  background: var(--brand-red);
  object-fit: cover;
}

.status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 3px solid var(--surface-low);
  background: var(--brand-yellow);
}

.hero h1 {
  max-width: 920px;
  margin-top: 32px;
  font-size: clamp(2rem, 4.8vw, 3.5rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero .tag-list {
  margin-top: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-resume {
  height: 44px;
  padding: 0 24px;
}

.hero-cta {
  position: relative;
  min-height: 294px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  overflow: hidden;
  padding: 32px 24px;
  border-color: color-mix(in srgb, var(--hero-cta-fg) 18%, transparent);
  background: var(--hero-cta-bg);
  color: var(--hero-cta-fg);
  text-align: center;
  isolation: isolate;
}

.loop-mark {
  width: 116px;
  max-width: 34%;
  height: auto;
  opacity: 0.92;
}

.hero-cta h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero-mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--hero-cta-btn-bg);
  color: var(--hero-cta-btn-fg);
  font-size: 0.875rem;
  font-weight: 500;
  transition: filter 0.2s ease, transform 0.2s var(--ease);
}

.hero-mail:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.hero-mail .icon {
  width: 20px;
  height: 20px;
}

.hero-mail span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marquee {
  margin-top: 12px;
  overflow: hidden;
  padding: 14px 0;
  border: 1px solid var(--outline-variant);
  border-radius: 14px;
  background: var(--surface-low);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 32s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}

.marquee-item {
  display: flex;
  align-items: center;
  color: var(--on-surface-variant);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.marquee-item > span:first-child {
  padding-inline: 16px;
}

.marquee-dot {
  margin-right: 16px;
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

@keyframes marquee-scroll {
  to {
    transform: translateX(-50%);
  }
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.social-grid a,
.social-grid button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--on-surface);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s var(--ease);
}

.social-grid a:hover,
.social-grid button:hover {
  background: var(--surface-highest);
  transform: translateY(-1px);
}

.social-grid .icon {
  width: 17px;
  height: 17px;
}

@media (max-width: 1023px) {
  .social-grid li:last-child {
    grid-column: 1 / -1;
  }
}

.work-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  scroll-margin-top: 96px;
}

.location-card {
  display: flex;
  flex-direction: column;
  min-height: 294px;
  padding: 24px;
  border-color: color-mix(in srgb, var(--location-fg) 16%, transparent);
  background: var(--location-bg);
  color: var(--location-fg);
}

.globe-mark {
  width: 104px;
  height: auto;
  color: var(--location-icon);
  opacity: 0.9;
  stroke-linecap: round;
}

.location-copy {
  margin-top: auto;
  padding-top: 40px;
}

.location-copy > p:first-child {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.location-copy > p:first-child span {
  color: var(--location-muted);
}

.location-note {
  margin-top: 16px;
  font-size: 0.8125rem;
  line-height: 1.5;
  opacity: 0.8;
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

.work-head h2 {
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.work-head a,
.work-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--on-surface-variant);
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.work-head a:hover,
.work-foot a:hover {
  color: var(--on-surface);
}

.work-head .icon,
.work-foot .icon {
  width: 16px;
  height: 16px;
}

.project-list {
  display: grid;
  flex: 1;
  gap: 8px;
}

.project-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 16px;
  border-top: 1px solid var(--outline-variant);
  border-radius: 0 0 16px 16px;
  color: var(--on-surface);
  text-align: left;
  transition: background-color 0.2s ease;
}

.project-card:hover {
  background: var(--surface-container);
}

.project-card b {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.project-card p {
  margin-top: 8px;
  color: var(--on-surface-variant);
  font-size: 0.8125rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.project-card .tag-row {
  margin-top: 12px;
}

.project-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 500;
}

.project-view .icon {
  width: 16px;
  height: 16px;
}

.work-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--outline-variant);
  color: var(--on-surface-variant);
  font-size: 0.75rem;
}

/* Sections */
.section {
  scroll-margin-top: 88px;
}

.section .wrap {
  padding-top: 56px;
}

.section-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.section-title-row h2 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  color: var(--on-surface-variant);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.eyebrow .icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.section-description {
  max-width: 672px;
  margin-top: 20px;
  color: var(--on-surface-variant);
  font-size: 1rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* About */
.about-grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.about-main {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.about-statement {
  max-width: 820px;
  color: var(--on-surface);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.degree-box {
  margin-top: 24px;
  padding: 16px;
  border: 1px dashed var(--outline);
  border-radius: 16px;
}

.degree-box b {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

.degree-box span {
  display: block;
  margin-top: 4px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.55;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.stat {
  padding: 16px 6px;
  border-radius: 16px;
  background: var(--surface-container);
  text-align: center;
}

.stat b {
  display: block;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 2rem;
  letter-spacing: -0.02em;
}

.stat em {
  color: var(--primary);
  font-style: normal;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--on-surface-variant);
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
}

.about-card small {
  color: var(--on-surface-variant);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.about-card b {
  margin-top: 8px;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.about-card .available-text {
  display: flex;
  align-items: center;
  gap: 9px;
}

.about-card p {
  margin-top: 8px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* Services */
.services-grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.service-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.service-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.service-card h3 {
  margin-top: 20px;
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.service-card > p {
  margin-top: 8px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.service-tags {
  margin-top: auto !important;
  padding-top: 20px;
  color: var(--primary) !important;
  font-family: var(--font-mono);
  font-size: 0.6875rem !important;
  font-weight: 500;
  line-height: 1.5 !important;
  letter-spacing: 0.035em;
}

/* Stack */
.stack-search {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  margin-top: 24px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-high);
  transition: border-color 0.2s ease;
}

.stack-search:focus-within {
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.stack-search > .icon {
  width: 22px;
  height: 22px;
  color: var(--on-surface-variant);
}

.stack-search input {
  width: 100%;
  height: 100%;
  min-width: 0;
  outline: none;
  color: var(--on-surface);
  font-size: 1rem;
}

.stack-search input::placeholder {
  color: var(--on-surface-variant);
  opacity: 1;
}

.search-clear {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--on-surface-variant);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.search-clear:hover {
  background: var(--surface-highest);
  color: var(--on-surface);
}

.stack-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.stack-card {
  padding: 24px;
}

.stack-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stack-head .icon-bubble {
  width: 36px;
  height: 36px;
}

.stack-head .icon-bubble .icon {
  width: 19px;
  height: 19px;
}

.stack-card h3 {
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.stack-card > p {
  margin-top: 8px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.55;
}

.stack-tags {
  margin-top: 16px;
}

.stack-empty {
  margin-top: 24px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
}

/* FAQ */
.faq-list {
  margin-top: 24px;
  overflow: hidden;
}

.faq-item + .faq-item {
  border-top: 1px solid var(--outline-variant);
}

.faq-trigger {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px;
  color: var(--on-surface);
  text-align: left;
  transition: background-color 0.2s ease;
}

.faq-trigger:hover {
  background: var(--surface-container);
}

.faq-plus {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
  transition:
    transform 0.3s var(--ease),
    background-color 0.3s ease,
    color 0.3s ease;
}

.faq-plus .icon {
  width: 18px;
  height: 18px;
}

.faq-trigger > span:last-child {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.faq-item.is-open .faq-plus {
  transform: rotate(45deg);
  background: var(--primary);
  color: var(--on-primary);
}

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease-out;
}

.faq-item.is-open .faq-panel {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
}

.faq-panel p {
  padding: 0 16px 20px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* Contact */
.contact-card {
  display: grid;
  gap: 32px;
  margin-top: 24px;
  padding: 24px;
}

.contact-copy h3 {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.contact-copy > p {
  margin-top: 16px;
  color: var(--on-surface-variant);
  font-size: 1rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.social-rings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.social-rings .tooltip-wrap {
  display: inline-flex;
}

.social-rings a,
.social-rings button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--outline);
  border-radius: 50%;
  background: transparent;
  color: var(--on-surface-variant);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.social-rings a:hover,
.social-rings button:hover {
  background: var(--surface-container);
  color: var(--on-surface);
}

.social-rings .icon {
  width: 18px;
  height: 18px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  position: relative;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 20px 16px 12px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: transparent;
  color: var(--on-surface);
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.2s ease;
}

.field textarea {
  min-height: 146px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 0;
}

.field label {
  position: absolute;
  top: 50%;
  left: 10px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-low);
  color: var(--on-surface-variant);
  font-size: 1rem;
  line-height: 1.5;
  pointer-events: none;
  transform: translateY(-50%);
  transition: top 0.15s var(--ease), font-size 0.15s var(--ease), color 0.15s ease;
}

.field textarea + label {
  top: 27px;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: 0;
  font-size: 0.75rem;
  line-height: 1rem;
}

.field:focus-within label {
  color: var(--primary);
}

.contact-submit {
  width: 100%;
  height: 48px;
  margin-top: 0;
  padding-inline: 26px;
}

.contact-submit .icon {
  width: 18px;
  height: 18px;
}

/* Footer */
.site-footer {
  padding: 28px 0 40px;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-inner > p {
  color: var(--on-surface-variant);
  font-size: 0.75rem;
  line-height: 1.5;
}

.footer-inner > p b {
  color: var(--on-surface);
  font-weight: 500;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.footer-links a,
.footer-links button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--on-surface-variant);
  font-family: inherit;
  font-size: 0.75rem;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--on-surface);
}

.footer-links .icon {
  width: 13px;
  height: 13px;
}

/* Back to top */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--backtop-bg);
  color: var(--backtop-fg);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease),
    background-color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.back-to-top:hover {
  filter: brightness(0.96);
}

.back-to-top > svg:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.back-to-top .progress-track {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  opacity: 0.2;
}

.back-to-top .progress-value {
  fill: none;
  stroke: var(--progress);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 0.15s linear;
}

.back-to-top .icon {
  position: relative;
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  visibility: hidden;
  pointer-events: none;
}

.mobile-menu.is-open {
  visibility: visible;
  pointer-events: auto;
}

.mobile-scrim {
  position: fixed;
  inset: 0;
  background: rgba(28, 8, 2, 0.38);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  border-top: 1px solid var(--panel-border);
  background: var(--surface-low);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}

.mobile-menu.is-open .mobile-scrim {
  opacity: 1;
}

.mobile-menu.is-open .mobile-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 32px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--on-surface-variant) 40%, transparent);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--on-surface);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav a .icon {
  width: 22px;
  height: 22px;
  color: var(--on-surface-variant);
}

.mobile-nav a[aria-current="true"] {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.mobile-nav a[aria-current="true"] .icon {
  color: var(--on-secondary-container);
}

.sheet-cta {
  margin-top: 8px;
  padding: 12px;
  border-top: 1px solid var(--outline-variant);
}

.sheet-cta .btn {
  width: 100%;
  height: 44px;
}

/* Dialog */
.project-dialog {
  width: min(512px, calc(100vw - 32px));
  max-height: calc(100svh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--panel-radius);
  background: transparent;
  color: var(--on-surface);
  overflow: auto;
}

.project-dialog::backdrop {
  background: rgba(28, 8, 2, 0.48);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.project-dialog[open] {
  animation: dialog-in 0.22s var(--ease);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dialog-inner {
  padding: 24px;
  border-radius: var(--panel-radius);
  background: var(--surface-high);
}

.dialog-icon {
  width: 48px;
  height: 48px;
  margin-inline: auto;
}

.dialog-icon .icon {
  width: 24px;
  height: 24px;
}

.project-dialog h2 {
  margin-top: 16px;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
}

.dialog-description {
  margin-top: 12px;
  color: var(--on-surface-variant);
  font-size: 0.875rem;
  line-height: 1.6;
  text-wrap: pretty;
}

.project-dialog .tag-row {
  margin-top: 16px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(384px, calc(100vw - 32px));
  padding: 8px 8px 8px 16px;
  border: 1px solid color-mix(in srgb, var(--toast-fg) 18%, transparent);
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast p {
  font-size: 0.875rem;
  line-height: 1.45;
}

.toast button {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--toast-action);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Reveal motion */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.5s var(--ease),
    transform 0.5s var(--ease);
  transition-delay: var(--delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 640px) {
  .header-cta {
    display: inline-flex;
  }

  .social-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-mail {
    min-height: 50px;
  }
}

@media (min-width: 768px) {
  .wrap {
    padding-inline: 32px;
  }

  .section .wrap {
    padding-top: 64px;
  }

  .hero {
    padding-top: 16px;
  }

  .hero-main,
  .hero-cta,
  .location-card,
  .work-card,
  .about-main,
  .about-card,
  .service-card,
  .stack-card,
  .contact-card {
    padding: 32px;
  }

  .hero-main .tag-list {
    margin-top: 28px;
  }

  .hero-cta h2 {
    font-size: 1.75rem;
    line-height: 1.25;
  }

  .loop-mark {
    width: 128px;
  }

  .avatar {
    width: 96px;
    height: 96px;
  }

  .globe-mark {
    width: 112px;
  }

  .section-title-row {
    flex-flow: row wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
  }

  .eyebrow {
    padding-bottom: 6px;
  }

  .about-grid,
  .services-grid,
  .stack-grid,
  .faq-list,
  .contact-card {
    margin-top: 32px;
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stack-search {
    margin-top: 32px;
  }

  .faq-trigger {
    gap: 16px;
    padding: 20px;
  }

  .faq-trigger > span:last-child {
    font-size: 1rem;
  }

  .faq-panel p {
    padding: 0 20px 20px 68px;
  }

  .contact-card {
    gap: 40px;
  }

  .contact-copy h3 {
    font-size: 1.875rem;
  }

  .footer-inner {
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
  }

  .back-to-top {
    right: 24px;
    bottom: 32px;
  }
}

@media (min-width: 1024px) {
  .wrap {
    padding-inline: 44px;
  }

  .section .wrap {
    padding-top: 80px;
  }

  .hero-grid {
    grid-template-columns: 1.55fr 1fr;
  }

  .about-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .work-grid {
    grid-template-columns: 1fr 1.55fr;
  }

  .social-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .hero-cta,
  .location-card {
    min-height: 100%;
  }

  .contact-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
  }

  .contact-copy h3 {
    font-size: 2rem;
  }

  .footer-inner {
    padding-top: 8px;
  }

  .back-to-top {
    right: 32px;
    bottom: 32px;
  }
}

@media (min-width: 1080px) {
  .primary-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

@media (max-width: 639px) {
  .header-cta {
    display: none;
  }

  .header-bar {
    gap: 6px;
    padding-right: 8px;
    padding-left: 10px;
  }

  .brand {
    gap: 9px;
  }
}

@media (max-width: 560px) {
  .brand-name {
    display: none;
  }

  .theme-switch button {
    width: 34px;
    height: 34px;
  }

  .theme-switch {
    height: 36px;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
  }

  .header-bar {
    height: 60px;
  }

  .site-header {
    top: 6px;
    margin-top: 6px;
  }

  .hero-cta {
    padding: 28px 20px;
  }

  .hero-mail {
    padding-inline: 18px;
    font-size: 0.8125rem;
  }

  .location-copy {
    padding-top: 32px;
  }

  .footer-inner {
    gap: 12px;
  }

  .toast {
    right: 16px;
    max-width: none;
  }
}

@media (max-width: 385px) {
  .wrap {
    padding-inline: 12px;
  }

  .header-bar {
    padding-left: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .theme-switch button {
    width: 32px;
  }

  .hero-cta h2 {
    font-size: 1.375rem;
  }

  .tag-list li {
    font-size: 0.75rem;
    padding-inline: 11px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .marquee-track {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
