:root {
  --background: lab(5.26802% 0 0);
  --background-1: lab(3.04863% 0 0);
  --background-2: lab(5.26802% 0 0);
  --background-3: lab(8.94% -0.00000745058 0);
  --text-primary: lab(100% 0 0 / 0.93);
  --text-secondary: lab(100% 0 0 / 0.6);
  --text-tertiary: lab(100% 0 0 / 0.33);
  --border: lab(100% 0 0 / 0.11);
  --border-muted: lab(100% 0 0 / 0.08);
  --border-strong: lab(100% 0 0 / 0.15);
  --surface-subtle: lab(100% 0 0 / 0.05);
  --surface-hover: lab(100% 0 0 / 0.03);
  --surface-active: lab(100% 0 0 / 0.05);
  --font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}

:root[data-theme="light"] {
  --background: lab(97% 0 0);
  --background-1: lab(100% 0 0);
  --background-2: lab(97% 0 0);
  --background-3: lab(94% 0 0);
  --text-primary: lab(8% 0 0 / 0.93);
  --text-secondary: lab(8% 0 0 / 0.6);
  --text-tertiary: lab(8% 0 0 / 0.4);
  --border: lab(8% 0 0 / 0.11);
  --border-muted: lab(8% 0 0 / 0.08);
  --border-strong: lab(8% 0 0 / 0.18);
  --surface-subtle: lab(8% 0 0 / 0.05);
  --surface-hover: lab(8% 0 0 / 0.04);
  --surface-active: lab(8% 0 0 / 0.06);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --background: lab(97% 0 0);
    --background-1: lab(100% 0 0);
    --background-2: lab(97% 0 0);
    --background-3: lab(94% 0 0);
    --text-primary: lab(8% 0 0 / 0.93);
    --text-secondary: lab(8% 0 0 / 0.6);
    --text-tertiary: lab(8% 0 0 / 0.4);
    --border: lab(8% 0 0 / 0.11);
    --border-muted: lab(8% 0 0 / 0.08);
    --border-strong: lab(8% 0 0 / 0.18);
    --surface-subtle: lab(8% 0 0 / 0.05);
    --surface-hover: lab(8% 0 0 / 0.04);
    --surface-active: lab(8% 0 0 / 0.06);
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark light;
}

*,
*::before,
*::after {
  transition-property: background-color, color, border-color, text-decoration-color, fill, stroke;
  transition-duration: 0.4s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wrap {
  max-width: 400px;
  margin: 0 auto;
  padding: 24px 16px 16px;
}

@media (min-width: 640px) {
  .wrap {
    padding: 112px 0 32px;
  }
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.theme-toggle {
  position: relative;
  height: 32px;
  width: 32px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-right: -6px;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

.theme-toggle:active {
  background: var(--surface-active);
  transform: scale(0.9);
}

.theme-toggle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
  opacity: 1;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-70deg) scale(0.5);
}

:root[data-theme="light"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(70deg) scale(0.5);
}

:root[data-theme="light"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle svg {
    transition: opacity 0.01ms !important;
  }
}

.hero {
  margin-top: 24px;
}

.hero p {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
}

.hero p:last-child {
  margin-bottom: 0;
}

@media (min-width: 640px) {
  .hero p {
    font-size: 14px;
    line-height: 20px;
  }
}

.hero a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color 0.2s ease;
}

.hero a:hover {
  text-decoration-color: var(--text-primary);
}

.hero .handle {
  color: var(--text-primary);
}

.section {
  margin-top: 64px;
}

.section-label {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.12px;
  color: var(--text-secondary);
}

.gallery-outer {
  margin-top: 16px;
  position: relative;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  overflow-x: auto;
  background: var(--background-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-outer::-webkit-scrollbar {
  display: none;
}

.gallery {
  display: flex;
  width: max-content;
  gap: 3px;
  padding-left: max(16px, calc((100vw - 400px) / 2));
  padding-right: max(16px, calc((100vw - 400px) / 2));
}

.work-card {
  flex-shrink: 0;
  width: calc(100vw - 32px);
  aspect-ratio: 1440 / 1024;
  background: var(--background-1);
  overflow: hidden;
  border: none;
  padding: 0;
  margin: 0;
  display: block;
  cursor: zoom-in;
  outline: none;
}

.work-card:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  .work-card {
    width: 540px;
  }
}

.work-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 96px 24px 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  overflow-y: auto;
  background-color: #131313;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.09) 1px, transparent 0);
  background-size: 15px 15px;
}

.lightbox::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.65) 100%);
}

.lightbox.open {
  display: flex;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background-color 0.15s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background-color 0.15s ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.14);
}

.lightbox-nav svg {
  width: 18px;
  height: 18px;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-frame {
  position: relative;
  width: min(900px, 100%);
  aspect-ratio: 1440 / 1024;
  background: var(--background-1);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55);
}

.lightbox-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lightbox-caption {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: rgba(255, 255, 255, 0.85);
}

.lightbox-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lightbox-dots button {
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.28);
  height: 6px;
  width: 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: width 0.15s ease, background-color 0.15s ease;
}

.lightbox-dots button.active {
  width: 16px;
  background: rgba(255, 255, 255, 0.85);
}

.timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.timeline-row {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid var(--border-muted);
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.timeline-row::-webkit-scrollbar {
  display: none;
}

.timeline-row:first-child {
  padding-top: 0;
}

.timeline-row:last-child {
  border-bottom: none;
}

@media (min-width: 640px) {
  .timeline-row {
    gap: 16px;
  }
}

.timeline-year {
  width: 112px;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
}

.timeline-role-org {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .timeline-year {
    font-size: 14px;
    line-height: 20px;
  }
}

.timeline-role {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-primary);
  white-space: nowrap;
}

.timeline-org {
  font-size: 14px;
  line-height: 20px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .timeline-role {
    font-size: 14px;
    line-height: 20px;
  }
}

.plain-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plain-list li {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .plain-list li {
    font-size: 14px;
    line-height: 20px;
  }
}

.stack-list li {
  position: relative;
  display: inline-flex;
  width: fit-content;
  cursor: default;
}

.stack-icon {
  position: absolute;
  left: 50%;
  bottom: 100%;
  z-index: 5;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(160deg, #fdfdfd, #e3e3e3);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.18),
    0 10px 20px -6px rgba(0, 0, 0, 0.4),
    0 20px 34px -12px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px) rotate(15deg) scale(0.75);
  transition: opacity 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stack-list li:hover .stack-icon {
  opacity: 1;
  transform: translate(-50%, 0) rotate(15deg) scale(1);
}

.stack-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.stack-icon-protopie img {
  width: 26px;
  height: 26px;
}

.stack-icon-notion {
  background: linear-gradient(160deg, #2f2f2f, #0f0f0f);
}

.stack-icon-notion img {
  width: 22px;
  height: 22px;
}

@media (prefers-reduced-motion: reduce) {
  .stack-icon {
    transition: opacity 0.15s ease;
    transform: translate(-50%, 0) rotate(15deg) scale(1);
  }
}

.contact-list a,
.contact-list button {
  font-size: 16px;
  line-height: 24px;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--border-strong);
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
  transition: text-decoration-color 0.2s ease;
}

.contact-list a:hover,
.contact-list button:hover {
  text-decoration-color: var(--text-primary);
}

@media (min-width: 640px) {
  .contact-list a,
  .contact-list button {
    font-size: 14px;
    line-height: 20px;
  }
}

.footer-row {
  margin-top: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.location {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .location {
    font-size: 12px;
    line-height: 16px;
  }
}

.version-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-subtle);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: -0.5px;
}

.version-pill .v {
  color: var(--text-tertiary);
}

.version-pill .num {
  color: var(--text-secondary);
}

@supports (view-transition-name: root) {
  ::view-transition-group(root) {
    animation-duration: 0.7s;
  }

  ::view-transition-old(root) {
    animation: none;
  }

  ::view-transition-new(root) {
    animation: theme-reveal 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

@keyframes theme-reveal {
  from {
    clip-path: circle(0px at var(--theme-x, 50%) var(--theme-y, 50%));
  }
  to {
    clip-path: circle(var(--theme-r, 150%) at var(--theme-x, 50%) var(--theme-y, 50%));
  }
}
