@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Geom:wght@600&display=swap");

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

:root {
  --max: 720px;
  --home-max: 1000px;
  --font-display: "Geom", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --text-h1: 28px;
  --text-h2: 22px;
  --text-h3: 16px;
  --text-body: 14px;
  --text-sub: 10px;
  --leading: 1.5;
  color-scheme: light dark;
}

[data-theme="light"] {
  --bg: #fffaf0;
  --heading: #2f2e36;
  --text: #2f2e36;
  --muted: #6b6578;
  --border: #ffe7d2;
  --surface: rgba(255, 250, 240, 0.88);
  --accent: #7c5cff;
  --figure-bg: #fff5e8;
  --bullet-color: #e97500;
}

[data-theme="dark"] {
  --bg: #000000;
  --heading: #ffffff;
  --text: #9aa3b3;
  --muted: #9aa3b3;
  --border: #1a1a1a;
  --surface: rgba(0, 0, 0, 0.88);
  --accent: #9fbfff;
  --figure-bg: #0a0a0a;
  --bullet-color: #9fbfff;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  letter-spacing: -0.07px;
  line-height: var(--leading);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3 {
  color: var(--heading);
}

h1,
.text-h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  font-weight: 600;
  letter-spacing: -0.14px;
  line-height: var(--leading);
}

h2,
.text-h2 {
  font-family: var(--font-sans);
  font-size: var(--text-h2);
  font-weight: 400;
  letter-spacing: -0.11px;
  line-height: var(--leading);
}

h3,
.text-h3 {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: -0.08px;
  line-height: var(--leading);
}

.text-body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  letter-spacing: -0.07px;
  line-height: var(--leading);
}

.text-sub {
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  line-height: var(--leading);
}

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

a:hover {
  opacity: 0.7;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1rem 0;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: 600;
  letter-spacing: -0.14px;
  line-height: var(--leading);
  color: var(--heading);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--muted);
}

.nav a:hover {
  color: var(--text);
  opacity: 1;
}

.theme-toggle,
.cv-button {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  isolation: isolate;
}

.cv-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.theme-toggle::before,
.cv-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid;
  z-index: 0;
  opacity: 1;
  transition: opacity 300ms ease-out;
}

[data-theme="light"] .theme-toggle::before,
[data-theme="light"] .cv-button::before {
  border-color: #2f2e36;
}

[data-theme="dark"] .theme-toggle::before,
[data-theme="dark"] .cv-button::before {
  border-color: #ffffff;
}

.theme-toggle::after,
.cv-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  opacity: 0;
  z-index: 1;
  transition: opacity 300ms ease-out;
}

[data-theme="light"] .theme-toggle::after,
[data-theme="light"] .cv-button::after {
  background: linear-gradient(180deg, #000000 0%, #0033a9 100%);
}

[data-theme="dark"] .theme-toggle::after,
[data-theme="dark"] .cv-button::after {
  background: linear-gradient(180deg, #ff845b 0%, #ac67ff 100%);
}

.theme-toggle:hover::before,
.cv-button:hover::before {
  opacity: 0;
}

.theme-toggle:hover::after,
.cv-button:hover::after {
  opacity: 1;
}

.cv-button__label {
  position: relative;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.06px;
  line-height: 1;
  transition: color 300ms ease-out;
}

[data-theme="light"] .cv-button__label {
  color: #2f2e36;
}

[data-theme="dark"] .cv-button__label {
  color: #ffffff;
}

.cv-button:hover .cv-button__label {
  color: #fffaf0;
}

.theme-toggle__icons {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon {
  position: absolute;
  width: 24px;
  height: 24px;
  display: block;
  transition: opacity 300ms ease-out;
}

.theme-toggle__icon--filled {
  opacity: 0;
}

.theme-toggle:hover .theme-toggle__icon--outline {
  opacity: 0;
}

.theme-toggle:hover .theme-toggle__icon--filled {
  opacity: 1;
}

[data-theme="light"] .theme-toggle__icon--sun {
  display: none;
}

[data-theme="dark"] .theme-toggle__icon--moon {
  display: none;
}

/* Home */
.page-home {
  color: var(--heading);
}

.home {
  padding: 100px 0;
}

.home__inner {
  width: min(100% - 2.5rem, var(--home-max));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.home-intro {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.home-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.home-logo {
  display: block;
  line-height: 0;
}

.home-logo img {
  width: auto;
  height: 29px;
  max-width: 100%;
}

[data-theme="light"] .page-home .home-logo img {
  filter: invert(1);
}

.home-tagline {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  color: inherit;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
}

.home-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.home-card:hover {
  opacity: 1;
}

.home-card__thumb {
  aspect-ratio: 2 / 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.home-card__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #363636;
  z-index: 0;
}

.home-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #8a38f5 0%, #68d0ff 100%);
  opacity: 0;
  transition: opacity 300ms ease-out;
  z-index: 1;
}

.home-card:hover .home-card__thumb::after {
  opacity: 1;
}

.home-card__thumb-inner {
  position: absolute;
  inset: 1px;
  z-index: 2;
  overflow: hidden;
}

.home-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.home-card__meta {
  display: flex;
  align-items: center;
  gap: 20px;
}

.home-card__title {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  color: inherit;
}

.home-card__rule {
  flex: 1 1 auto;
  height: 1px;
  min-width: 0;
  position: relative;
  background: #363636;
}

.home-card__rule::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #8a38f5 0%, #68d0ff 100%);
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.home-card:hover .home-card__rule::after {
  opacity: 1;
}

.home-card__company {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 300;
  line-height: normal;
  color: inherit;
}

[data-theme="light"] .home-card__thumb::before {
  background: #f1ebe5;
}

[data-theme="light"] .home-card__rule {
  background: #f1ebe5;
}

@media (max-width: 720px) {
  .home {
    padding: 64px 0;
  }

  .home__inner {
    gap: 40px;
  }

  .home-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Legacy home project list (case study pages reference shared tokens) */
.hero {
  padding: 4rem 0 3rem;
}

.hero h1 {
  margin-bottom: 0.75rem;
}

.hero p {
  max-width: 36ch;
}

.projects {
  padding: 1rem 0 5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.project-card {
  display: block;
}

.project-card:hover {
  opacity: 1;
}

.project-card:hover .project-thumb {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.project-thumb {
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.project-thumb.placeholder {
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.project-meta h2 {
  margin-bottom: 0.1rem;
}

.project-meta span {
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--muted);
}

/* Case study */
.case-hero {
  padding: 2rem 0 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.case-hero__thumb {
  aspect-ratio: 2 / 1;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.case-hero__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #363636;
  z-index: 0;
}

.case-hero__thumb-inner {
  position: absolute;
  inset: 1px;
  z-index: 1;
  overflow: hidden;
}

.case-hero__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.case-hero__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.case-hero__meta h1 {
  margin-bottom: 0;
}

.case-hero__company {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 300;
  line-height: normal;
  color: var(--heading);
}

[data-theme="light"] .case-hero__thumb::before {
  background: #f1ebe5;
}

.case-hero .cover {
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.75rem;
  background: var(--border);
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
}

.case-hero .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.case-header {
  color: var(--heading);
}

.case-header__inner {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  padding-top: 40px;
  margin-bottom: 40px;
}

[data-theme="light"] .case-header .home-logo img {
  filter: invert(1);
}

.case-anchor {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.case-anchor__inner {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.case-anchor a {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: -0.08px;
  line-height: var(--leading);
  color: var(--heading);
}

.case-anchor a:hover {
  color: var(--text);
  opacity: 1;
}

.case-section h2[id] {
  scroll-margin-top: 3.5rem;
}

.case-section {
  padding: calc(2.5rem + 5px) 0;
  border-top: 1px solid var(--border);
}

.case-section h2 {
  margin-bottom: calc(1rem + 5px);
}

.case-section h3 {
  margin: calc(1.5rem + 5px) 0 calc(0.5rem + 5px);
}

.case-section p {
  margin-bottom: 1rem;
}

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

.case-section ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.case-section ul:last-child {
  margin-bottom: 0;
}

.case-section li,
.resume-item li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-bottom: calc(0.5rem + 5px);
}

.case-section li::before,
.resume-item li::before {
  content: "";
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  margin-top: calc(0.5lh - 5.5px);
  background-color: var(--bullet-color);
  -webkit-mask-image: url("/assets/bullet.svg");
  mask-image: url("/assets/bullet.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.case-section li:last-child {
  margin-bottom: 0;
}

.case-section .label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.case-section .emphasis {
  font-weight: 600;
}

.case-example {
  margin: calc(1.5rem + 5px) 0;
}

.case-example__label {
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: -0.08px;
  line-height: var(--leading);
  color: var(--heading);
  margin-bottom: calc(0.5rem + 5px);
}

.case-example .case-figure {
  margin: 0;
}

.case-figure {
  margin: 20px 0;
  padding: 1.5rem;
  background-color: var(--figure-bg);
  border: 1px solid var(--border);
}

.case-figure img {
  width: 100%;
  display: block;
}

.case-video {
  width: 100%;
  display: block;
  background: #000;
}

.case-figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  line-height: var(--leading);
  color: var(--muted);
}

.img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.img-grid img,
.figure img {
  border-radius: 8px;
  border: 1px solid var(--border);
}

.figure {
  margin: 1.25rem 0;
}

.figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tag {
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  background: var(--surface);
}

.back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--muted);
}

/* Resume */
.resume {
  padding: 2rem 0 5rem;
}

.resume h1 {
  margin-bottom: 0.35rem;
}

.resume .subtitle {
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--muted);
  margin-bottom: 2rem;
}

.resume-block {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.resume-block h2 {
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.resume-item {
  margin-bottom: 1.25rem;
}

.resume-item:last-child {
  margin-bottom: 0;
}

.resume-item h3 {
  margin-bottom: 0.15rem;
}

.resume-item .meta {
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.resume-item p,
.resume-item ul {
  color: inherit;
}

.resume-item ul {
  list-style: none;
  padding-left: 0;
}

.resume-item li {
  margin-bottom: 0.35rem;
}

.resume-item li:last-child {
  margin-bottom: 0;
}

.download-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  background: var(--surface);
}

.download-btn:hover {
  opacity: 1;
  border-color: var(--muted);
}

.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: var(--text-sub);
  font-weight: 500;
  letter-spacing: -0.05px;
  color: var(--muted);
  background: var(--surface);
}

@media (max-width: 560px) {
  .img-grid {
    grid-template-columns: 1fr;
  }

  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
