@font-face {
  font-family: "Source Sans Pro";
  src: url("../fonts/SourceSansPro-Regular.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans Pro";
  src: url("../fonts/SourceSansPro-Semibold.otf") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --border: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --shadow-xs: 0 1px 2px 0 oklch(0.145 0 0 / 0.05);
}

:root[data-theme="dark"] {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --border: oklch(1 0 0 / 0.1);
  --ring: oklch(0.556 0 0);
  --shadow-xs: 0 1px 2px 0 oklch(0 0 0 / 0.25);
}

* {
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Source Sans Pro", sans-serif;
  font-size: 16px;
  line-height: 24px;
  text-rendering: optimizeLegibility;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  appearance: none;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--ring) 50%, transparent);
  outline-offset: 2px;
}

code,
pre {
  font-family: "Geist Mono", monospace;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  font-size: 12px;
  transform: translateY(-160%);
}

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

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

.site-main {
  min-height: 100vh;
  overflow-x: clip;
  padding: 32px 20px;
  background: var(--background);
  color: var(--foreground);
}

.site-container {
  display: flex;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  flex-direction: column;
}

.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 32px;
  align-items: flex-start;
  column-gap: 16px;
  margin-top: -12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.intro-copy {
  width: 100%;
  min-width: 0;
}

.header-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.profile-portrait {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

h1 {
  min-width: 0;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.5;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.5;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.intro-copy > p {
  max-width: 36rem;
  margin-top: 12px;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 24px;
}

.icon-button {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--background);
  box-shadow: var(--shadow-xs);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}

.icon-button:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.theme-toggle {
  margin: 0;
}

.theme-icon {
  display: inline-flex;
}

.theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: inline-flex;
}

.action-row {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.button {
  display: inline-flex;
  height: 32px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  box-shadow: var(--shadow-xs);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease-out, border-color 150ms ease-out, color 150ms ease-out;
}

.button-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.button-secondary:hover {
  background: color-mix(in oklab, var(--secondary) 80%, transparent);
}

.button-outline {
  border-color: var(--border);
  background: var(--background);
}

.button-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.button-support {
  border-color: oklch(0.811 0.111 293.571 / 0.7);
  background: oklch(0.606 0.25 292.717 / 0.05);
  color: oklch(0.491 0.27 292.581);
}

.button-support:hover {
  border-color: oklch(0.702 0.183 293.541);
  background: oklch(0.606 0.25 292.717 / 0.1);
  color: oklch(0.432 0.232 292.759);
}

.copy-button-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  align-items: center;
  justify-content: center;
  transform-origin: center;
}

.copy-button-icon > span:not(.sr-only) {
  display: inline-flex;
}

.copy-button-icon > span[hidden] {
  display: none;
}

.copy-button-icon.is-entering {
  animation: copy-icon-in 500ms cubic-bezier(0.33, 1, 0.68, 1) both;
}

@keyframes copy-icon-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.divider {
  width: 100%;
  height: 0;
  margin: 32px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.section-stack {
  display: flex;
  flex-direction: column;
  scroll-margin-top: 168px;
}

.section-copy {
  max-width: 65ch;
  margin-top: 12px;
  margin-bottom: 8px;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 24px;
}

.focus-list {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.focus-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) 1fr;
  gap: 20px;
}

.focus-item p {
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 22px;
}

.project-list {
  display: grid;
  gap: 32px;
  margin-top: 12px;
}

.project-entry {
  display: grid;
  gap: 12px;
}

.project-copy {
  display: grid;
  gap: 4px;
}

.project-copy h3 a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-copy p {
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 24px;
}

.project-panel {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklch, var(--card) 40%, transparent);
}

.project-meta {
  color: var(--muted-foreground);
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 18px;
}

.project-links,
.detail-actions,
.tag-list,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.project-links {
  justify-content: flex-end;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-links a:hover {
  color: color-mix(in oklch, var(--foreground) 70%, transparent);
}

.about-copy + .about-copy {
  margin-top: 8px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 24px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 18px;
}

.site-footer a,
.detail-nav a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.floating-control {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--foreground);
  box-shadow: 0 8px 24px oklch(0.145 0 0 / 0.16);
  color: var(--background);
  cursor: pointer;
}

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

.detail-nav > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.detail-header {
  display: grid;
  gap: 12px;
  margin-top: 40px;
}

.detail-header > p:not(.detail-label) {
  max-width: 65ch;
  color: var(--muted-foreground);
  font-size: 15.2px;
  line-height: 24px;
}

.detail-label {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 18px;
  text-transform: uppercase;
}

.tag-list span {
  padding: 2px 6px;
  border-radius: 4px;
  background: oklch(0.95 0.052 163.051);
  color: oklch(0.508 0.118 165.612);
  font-size: 11px;
  line-height: 18px;
}

:root[data-theme="dark"] .tag-list span {
  background: oklch(0.765 0.177 163.223 / 0.16);
  color: oklch(0.905 0.093 164.15);
}

.detail-actions {
  margin-top: 4px;
}

.prose {
  color: var(--foreground);
  font-size: 15px;
  line-height: 26px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3 {
  margin-top: 32px;
  margin-bottom: 12px;
}

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose blockquote {
  margin-top: 0;
  margin-bottom: 18px;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in oklch, var(--secondary) 55%, transparent);
  font-size: 13px;
  line-height: 20px;
}

.prose code:not(pre code) {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--secondary);
  font-size: 0.88em;
}

.prose blockquote {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-foreground);
}

@media (min-width: 640px) {
  .site-main {
    padding: 40px 24px;
  }

  h1 {
    font-size: 1.95rem;
  }

  .intro-copy > p {
    font-size: 15.2px;
  }
}

@media (max-width: 639px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) 80px 32px;
  }

  .profile-portrait {
    width: 80px;
    height: 80px;
    border-radius: 10px;
  }

  .focus-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .project-panel,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-links {
    justify-content: flex-start;
  }

  .floating-control {
    right: 20px;
    bottom: 20px;
  }
}

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

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