/* =============================================================================
   Portfolio design system
   Cool rose · blue diffuse light · warm orange accents · light + dark.
   Tokens adapted from DESIGN.md.
   ========================================================================== */

:root {
  /* Brand constants (do not change between themes) */
  --navy: #151826;
  --navy-2: #1f2937;
  /* Muted reference-inspired rose with a clear blue partner. */
  --pink: #e78fb0;
  --pink-strong: #d96f9f;
  --pink-deep: #c85686;
  --blue: #4f83f1;
  --blue-deep: #2f6fed;
  --orange: #f49a4d;
  --yellow: #ffd36a;
  --violet: #8e8ee8;
  --periwinkle: #a9b9ee;
  --peach: #f4b08b;

  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;

  /* Light theme surfaces / text */
  --background: #f6f7fb;
  --foreground: #111827;
  --card: #ffffff;
  --card-foreground: #111827;
  --muted: #eef1f6;
  --muted-foreground: #64748b;
  --border: #dbe2ea;
  --accent-soft: #fff6f9;        /* rose-tinted panel wash */
  --header-bg: rgba(255, 255, 255, 0.85);   /* light, frosted header */
  /* Lovable-inspired depth: lean on borders, keep shadows shallow & soft. */
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(15, 23, 42, 0.10);
  --shadow-accent: 0 6px 18px rgba(217, 111, 159, 0.22);
  --pink-hover-gradient: linear-gradient(
    90deg,
    color-mix(in srgb, #d96f9f 16%, var(--card)) 0%,
    color-mix(in srgb, #e78fb0 15%, var(--card)) 58%,
    color-mix(in srgb, #f0aec6 18%, var(--card)) 100%
  );
  /* Signature inset shadow for tactile, pressed-in buttons. */
  --shadow-inset: rgba(255, 255, 255, 0.22) 0 0.5px 0 0 inset,
    rgba(0, 0, 0, 0.2) 0 0 0 0.5px inset, rgba(0, 0, 0, 0.06) 0 1px 2px 0;
  --shadow-focus: rgba(0, 0, 0, 0.1) 0 4px 12px;

  --primary: var(--pink);
  --ring: var(--pink);
  --radius: 8px;
  --radius-pill: 9999px;
  --maxw: 960px;
  --grain-opacity: 0.18;

  /* Calm base; the diffuse aurora layer (body::before) supplies the color. */
  --page-bg: linear-gradient(180deg, #f8f8fb 0%, #ffffff 100%);
}

[data-theme="dark"] {
  --background: #0f1320;
  --foreground: #e5e7eb;
  --card: #1f2937;
  --card-foreground: #e5e7eb;
  --muted: #1b2333;
  --muted-foreground: #9aa6b8;
  --border: #2c3850;
  --accent-soft: #241a23;
  --header-bg: rgba(15, 19, 32, 0.85);   /* dark, frosted header */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-focus: rgba(0, 0, 0, 0.5) 0 4px 12px;
  --grain-opacity: 0.14;

  --page-bg: linear-gradient(180deg, #101522 0%, #151826 100%);
}

/* ----------------------------------------------------------------- base ---- */

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Noto Sans KR",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.6;
  color: var(--foreground);
  background: transparent;
  background-attachment: fixed;
  letter-spacing: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* Diffuse light: soft, heavily blurred rose + blue + warm orange fields. */
body::before {
  content: "";
  position: absolute;
  inset: -15%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42% 36% at 19% 28%, rgba(217, 111, 159, 0.48), transparent 64%),
    radial-gradient(44% 36% at 82% 18%, rgba(79, 131, 241, 0.46), transparent 64%),
    radial-gradient(44% 38% at 72% 74%, rgba(244, 154, 77, 0.38), transparent 64%),
    radial-gradient(40% 34% at 24% 80%, rgba(255, 211, 106, 0.28), transparent 64%);
  filter: blur(62px) saturate(108%) contrast(104%);
  animation: aurora-in 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
body.is-home::before {
  inset: -30% -18% 0;
  background:
    radial-gradient(30% 26% at 46% 30%, rgba(217, 111, 159, 0.58), transparent 64%),
    radial-gradient(38% 30% at 74% 16%, rgba(79, 131, 241, 0.46), transparent 66%),
    radial-gradient(34% 30% at 58% 70%, rgba(244, 154, 77, 0.36), transparent 68%),
    radial-gradient(40% 34% at 24% 80%, rgba(255, 211, 106, 0.25), transparent 64%);
  animation: home-aurora-settle 1.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
html.is-home {
  background:
    radial-gradient(58% 44% at 16% 8%, rgba(255, 211, 106, 0.14), transparent 72%),
    radial-gradient(50% 42% at 46% 12%, rgba(244, 154, 77, 0.08), transparent 72%),
    var(--page-bg);
}
body.page-cv::before {
  background:
    radial-gradient(42% 34% at 78% 28%, rgba(217, 111, 159, 0.46), transparent 64%),
    radial-gradient(40% 34% at 22% 22%, rgba(79, 131, 241, 0.42), transparent 64%),
    radial-gradient(42% 36% at 52% 82%, rgba(244, 154, 77, 0.34), transparent 66%),
    radial-gradient(34% 30% at 92% 70%, rgba(255, 211, 106, 0.24), transparent 64%);
}
body.page-publications::before {
  background:
    radial-gradient(40% 34% at 16% 62%, rgba(217, 111, 159, 0.46), transparent 64%),
    radial-gradient(46% 36% at 78% 22%, rgba(79, 131, 241, 0.44), transparent 64%),
    radial-gradient(38% 34% at 86% 78%, rgba(244, 154, 77, 0.34), transparent 66%),
    radial-gradient(34% 30% at 34% 18%, rgba(255, 211, 106, 0.24), transparent 64%);
}
body.page-projects::before {
  background:
    radial-gradient(42% 34% at 22% 30%, rgba(217, 111, 159, 0.46), transparent 64%),
    radial-gradient(46% 36% at 88% 42%, rgba(79, 131, 241, 0.42), transparent 64%),
    radial-gradient(42% 36% at 68% 84%, rgba(244, 154, 77, 0.36), transparent 66%),
    radial-gradient(34% 30% at 18% 82%, rgba(255, 211, 106, 0.24), transparent 64%);
}
body.page-blog::before,
body.page-archives::before {
  background:
    radial-gradient(42% 34% at 72% 18%, rgba(217, 111, 159, 0.45), transparent 64%),
    radial-gradient(46% 36% at 18% 68%, rgba(79, 131, 241, 0.43), transparent 64%),
    radial-gradient(40% 34% at 88% 82%, rgba(244, 154, 77, 0.34), transparent 66%),
    radial-gradient(34% 30% at 42% 34%, rgba(255, 211, 106, 0.23), transparent 64%);
}
body.page-misc::before {
  background:
    radial-gradient(42% 34% at 18% 78%, rgba(217, 111, 159, 0.45), transparent 64%),
    radial-gradient(44% 36% at 66% 18%, rgba(79, 131, 241, 0.42), transparent 64%),
    radial-gradient(40% 34% at 90% 58%, rgba(244, 154, 77, 0.34), transparent 66%),
    radial-gradient(36% 32% at 34% 42%, rgba(255, 211, 106, 0.25), transparent 64%);
}
[data-theme="dark"] body::before {
  filter: blur(68px) saturate(116%) brightness(0.74);
  opacity: 0.8;
}

/* Lo-fi film grain over the diffuse background. */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  animation: grain-in 1.8s ease-out both;
}
[data-theme="dark"] body::after {
  mix-blend-mode: screen;
}

@keyframes aurora-in {
  from { opacity: 0; transform: scale(1.12) translateY(-12px); filter: blur(120px) saturate(108%); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes grain-in {
  from { opacity: 0; }
  to   { opacity: var(--grain-opacity); }
}
@keyframes home-aurora-settle {
  0% {
    opacity: 0;
    transform: scale(1.24) rotate(-4deg) translate3d(-28px, 24px, 0);
    filter: blur(100px) saturate(150%) contrast(112%);
  }
  54% {
    opacity: 1;
    transform: scale(0.98) rotate(1deg) translate3d(10px, -8px, 0);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0) translate3d(0, 0, 0);
    filter: blur(62px) saturate(116%) contrast(104%);
  }
}

a {
  color: var(--pink-strong);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Editorial headings: restrained weight, tight tracking that scales with size
   (Lovable-style), instead of heavy black weights. */
h1, h2, h3 {
  color: var(--foreground);
  text-wrap: balance;
  font-weight: 700;
}
h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.6rem;
}
h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.022em;
  margin: 2.25rem 0 0.85rem;
}
h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p { margin: 0 0 1rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  background: var(--muted);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
pre {
  background: var(--navy);
  color: #e5e7eb;
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border-left: 4px solid var(--pink);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--card));
  color: var(--card-foreground);
}
blockquote p:last-child {
  margin-bottom: 0;
}
figure {
  margin: 1.5rem 0;
}
figure[data-ke-type="opengraph"] a {
  display: grid;
  grid-template-columns: minmax(120px, 32%) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
}
figure[data-ke-type="opengraph"] a:hover {
  text-decoration: none;
  box-shadow: var(--shadow-card-hover);
}
.og-image {
  min-height: 120px;
  background-color: var(--muted);
  background-position: center;
  background-size: cover;
}
.og-text {
  min-width: 0;
  padding: 1rem;
}
.og-title {
  margin-bottom: 0.35rem;
  color: var(--foreground);
  font-weight: 700;
}
.og-desc,
.og-host {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}
.imageblock,
figure[data-ke-type="video"] {
  overflow: hidden;
  border-radius: var(--radius);
}
@media (max-width: 640px) {
  figure[data-ke-type="opengraph"] a {
    grid-template-columns: 1fr;
  }
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

.muted { color: var(--muted-foreground); }

/* --------------------------------------------------------------- header ---- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Thin reference accent: rose → blue → warm orange, not a rainbow strip. */
.accent-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--blue) 56%, var(--orange));
  opacity: 0.75;
}

.header-inner {
  --header-x-padding: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--header-x-padding);
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  position: relative;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
}
.brand img,
.brand svg {
  height: 34px;
  width: auto;
  display: block;
}

/* centered nav */
.site-nav {
  justify-self: center;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.site-nav a:hover {
  color: var(--blue-deep);
  text-decoration: none;
}
/* Active item: blue text + the same blue-only gradient as primary buttons. */
.site-nav a.is-active {
  color: var(--blue-deep);
  font-weight: 600;
}
.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 58%, var(--periwinkle) 100%);
}

.header-actions {
  justify-self: end;
}

.theme-toggle,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.15s ease;
}
.theme-toggle:hover { background: var(--muted); }
.theme-toggle:active,
.menu-toggle:active { opacity: 0.82; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.menu-toggle {
  display: none;
  background: color-mix(in srgb, var(--blue) 16%, var(--card));
  color: var(--blue-deep);
}
.menu-toggle:hover {
  background: color-mix(in srgb, var(--blue) 24%, var(--card));
}
.menu-toggle svg {
  width: 21px;
  height: 21px;
}
/* mobile: logo + actions row, nav folds into the hamburger menu */
@media (max-width: 820px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    height: 68px;
    gap: 0.5rem;
  }
  .header-actions {
    position: absolute;
    top: 50%;
    right: var(--header-x-padding);
    transform: translateY(-50%);
    margin-right: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
  .menu-toggle {
    display: inline-flex;
    border: 0;
  }
  .brand img,
  .brand svg {
    height: 40px;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    right: var(--header-x-padding);
    width: min(11rem, calc(100vw - 2rem));
    justify-self: auto;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow-card-hover);
  }
  .site-header.is-menu-open .site-nav {
    display: block;
  }
  .site-nav ul {
    display: grid;
    gap: 0.15rem;
  }
  .site-nav a {
    display: block;
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
    text-align: center;
  }
  .site-nav a.is-active::after {
    left: 50%;
    right: auto;
    width: 2.5rem;
    transform: translateX(-50%);
    bottom: 0.25rem;
  }
  .theme-toggle,
  .menu-toggle {
    width: 38px;
    height: 38px;
  }
}

/* ----------------------------------------------------------------- main ---- */

.site-main {
  flex: 1 0 auto;
  padding: calc(4rem + 66px) 0 5rem;
  position: relative;
  z-index: 0;
}
.site-main > .container {
  position: relative;
  z-index: 1;
}

@media (max-width: 820px) {
  .site-main { padding-top: calc(4rem + 70px); }
}

/* generic content card / panel — containment by border, not shadow */
.app-surface {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
}
@media (max-width: 600px) {
  .site-main { padding: calc(2.5rem + 70px) 0 3rem; }
  .app-surface { padding: 1.5rem; }
}

.page-header {
  margin-bottom: 1.5rem;
}
.page-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.page-title-row h1 {
  margin-bottom: 0.6rem;
}
.page-header-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--pink-strong) 48%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--pink-strong);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}
.page-header-action:hover {
  background: var(--pink-hover-gradient);
  text-decoration: none;
}
.page-header-action.is-disabled {
  cursor: default;
  opacity: 0.62;
  color: var(--muted-foreground);
  border-color: var(--border);
  background: color-mix(in srgb, var(--muted) 62%, transparent);
}
.page-header-action.is-disabled:hover {
  background: color-mix(in srgb, var(--muted) 62%, transparent);
}
.post-surface {
  position: relative;
}
.post-surface .page-header {
  padding-right: 5.25rem;
}
.post-language-action {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 2;
}
@media (max-width: 600px) {
  .post-surface .page-header { padding-right: 4.5rem; }
  .post-language-action {
    top: 0.85rem;
    right: 0.85rem;
  }
}
.page-header p {
  color: var(--muted-foreground);
  margin: 0;
}
.page-shell .page-header {
  margin-bottom: 2rem;
}
.page-shell .page-header h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.7rem, 6vw, 4.6rem);
  letter-spacing: -0.015em;
}
.page-shell .page-header p {
  max-width: 34rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
}
@media (min-width: 821px) {
  .page-shell .page-header p {
    max-width: none;
    white-space: nowrap;
  }
}

.soft-list {
  display: grid;
  gap: 0.9rem;
  width: 100%;
}
.soft-item {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--card) 66%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  padding: 1.25rem;
}
.soft-item h3 {
  margin-top: 0;
}
.soft-item p:last-child {
  margin-bottom: 0;
}
.entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.1rem;
}
.entry-date {
  color: var(--muted-foreground);
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  text-align: right;
}
.cv-accent {
  color: var(--pink-strong);
  font-weight: 600;
}
.cv-list .soft-item h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--blue-deep);
}
.cv-list .soft-item h3::before {
  content: "";
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent);
}
.cv-bullets {
  margin: -0.35rem 0 1rem 1.2rem;
  padding: 0;
}
.cv-bullets li {
  margin: 0.15rem 0;
  padding-left: 0.1rem;
}
.cv-bullets:last-child {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .entry-head {
    display: block;
    margin-bottom: 0.15rem;
  }
  .entry-date {
    display: block;
    margin-top: 0.1rem;
    text-align: right;
    white-space: normal;
  }
  .cv-bullets {
    margin-top: 0.35rem;
  }
}

.misc-list .soft-item h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--pink-deep);
}
.misc-list .soft-item h3::before {
  content: "";
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
}
.misc-section-studies h3::before {
  background: var(--pink-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink-deep) 14%, transparent);
}
.misc-section-activities h3::before {
  background: var(--pink-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink-deep) 14%, transparent);
}
.misc-section-hobbies h3::before {
  background: var(--pink-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink-deep) 14%, transparent);
}
.misc-list a {
  color: var(--pink-strong);
}
.misc-list a:hover {
  color: var(--pink-deep);
}
.item-kicker {
  color: var(--pink-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.publication-list .item-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  width: fit-content;
  margin-bottom: 0.78rem;
  padding: 0.24rem 0.58rem;
  border: 1px solid color-mix(in srgb, var(--pink-strong) 34%, var(--border));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent-soft) 82%, transparent);
  font-size: 0.68rem;
  line-height: 1;
  letter-spacing: 0.06em;
}
.publication-list .item-kicker::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--pink-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink-strong) 16%, transparent);
}
.publication-list .soft-item h3 {
  margin-top: 0;
  margin-bottom: 0.85rem;
}
.publication-note {
  margin-top: -0.35rem;
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 0.78rem;
  line-height: 1.35;
}
.item-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted-foreground);
  font-size: 0.95rem;
}

/* repeated interactive cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}
.interactive-card {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, var(--card) 66%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  padding: 1.5rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.interactive-card h3 { margin-top: 0; }
@media (hover: hover) {
  .interactive-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--pink-strong) 36%, var(--border));
    background: var(--pink-hover-gradient);
    box-shadow: var(--shadow-accent);
  }
}
[data-theme="dark"] .interactive-card:hover {
  border-color: color-mix(in srgb, var(--pink) 48%, var(--border));
}

.project-card {
  display: block;
  overflow: hidden;
  padding: 0;
  color: inherit;
  text-decoration: none;
}
.project-card:hover {
  text-decoration: none;
}
.project-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--muted);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.project-card-body {
  padding: 1.35rem 1.4rem 1.45rem;
}
.project-card-body h3 {
  margin: 0 0 0.45rem;
}
.project-card-body p {
  margin: 0;
}
.project-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.project-media-grid a {
  display: block;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--radius);
  background: var(--muted);
}
.project-media-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* empty state */
.empty-state {
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: color-mix(in srgb, var(--muted) 45%, transparent);
  padding: 2rem;
  text-align: center;
  color: var(--muted-foreground);
}
.empty-state .empty-icon {
  color: var(--pink);
  width: 28px;
  height: 28px;
  margin-bottom: 0.5rem;
}
.empty-state strong {
  display: block;
  color: var(--foreground);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* --------------------------------------------------------------- about ----- */

.about {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: center;
  gap: clamp(2rem, 7vw, 5rem);
  text-align: left;
  max-width: 1040px;
  margin: 0 auto;
  padding-top: clamp(0.5rem, 2vw, 2rem);
}
.home-bubbles {
  position: absolute;
  top: -24vh;
  right: 0;
  left: 0;
  height: calc(100% + 24vh);
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}
.home-bubble {
  position: absolute;
  display: block;
  width: var(--bubble-size);
  height: var(--bubble-size);
  border-radius: 50%;
  background: radial-gradient(circle, var(--bubble-color) 0 30%, var(--bubble-glow) 32% 62%, transparent 66%);
  opacity: 0;
  will-change: transform, opacity;
  animation:
    home-bubble-pop 900ms var(--bubble-delay) cubic-bezier(0.16, 1, 0.3, 1) both,
    var(--bubble-path) var(--bubble-duration) calc(var(--bubble-delay) + 900ms) ease-in-out infinite alternate;
}
.bubble-1 {
  --bubble-size: 14px;
  --bubble-color: rgba(217, 111, 159, 0.42);
  --bubble-glow: rgba(217, 111, 159, 0.11);
  --bubble-delay: 0.1s;
  --bubble-duration: 38s;
  --bubble-path: home-bubble-path-a;
  left: 4vw;
  top: 42vh;
}
.bubble-2 {
  --bubble-size: 24px;
  --bubble-color: rgba(79, 131, 241, 0.34);
  --bubble-glow: rgba(79, 131, 241, 0.10);
  --bubble-delay: 0.2s;
  --bubble-duration: 34s;
  --bubble-path: home-bubble-path-b;
  left: 22vw;
  top: 30vh;
}
.bubble-3 {
  --bubble-size: 44px;
  --bubble-color: rgba(231, 143, 176, 0.34);
  --bubble-glow: rgba(231, 143, 176, 0.10);
  --bubble-delay: 0.3s;
  --bubble-duration: 48s;
  --bubble-path: home-bubble-path-c;
  left: 42vw;
  top: 20vh;
}
.bubble-4 {
  --bubble-size: 14px;
  --bubble-color: rgba(244, 154, 77, 0.32);
  --bubble-glow: rgba(244, 154, 77, 0.10);
  --bubble-delay: 0.18s;
  --bubble-duration: 32s;
  --bubble-path: home-bubble-path-b;
  left: 88vw;
  top: 52vh;
}
.bubble-5 {
  --bubble-size: 34px;
  --bubble-color: rgba(217, 111, 159, 0.32);
  --bubble-glow: rgba(217, 111, 159, 0.10);
  --bubble-delay: 0.36s;
  --bubble-duration: 42s;
  --bubble-path: home-bubble-path-a;
  left: 76vw;
  top: 26vh;
}
.bubble-6 {
  --bubble-size: 54px;
  --bubble-color: rgba(255, 211, 106, 0.28);
  --bubble-glow: rgba(255, 211, 106, 0.10);
  --bubble-delay: 0.24s;
  --bubble-duration: 52s;
  --bubble-path: home-bubble-path-c;
  left: 92vw;
  top: 78vh;
}
.bubble-7 {
  --bubble-size: 22px;
  --bubble-color: rgba(255, 211, 106, 0.34);
  --bubble-glow: rgba(255, 211, 106, 0.10);
  --bubble-delay: 0.44s;
  --bubble-duration: 36s;
  --bubble-path: home-bubble-path-d;
  left: 14vw;
  top: 76vh;
}
.bubble-8 {
  --bubble-size: 14px;
  --bubble-color: rgba(79, 131, 241, 0.32);
  --bubble-glow: rgba(79, 131, 241, 0.10);
  --bubble-delay: 0.3s;
  --bubble-duration: 30s;
  --bubble-path: home-bubble-path-d;
  left: 56vw;
  top: 84vh;
}
.bubble-9 {
  --bubble-size: 38px;
  --bubble-color: rgba(244, 154, 77, 0.28);
  --bubble-glow: rgba(244, 154, 77, 0.09);
  --bubble-delay: 0.14s;
  --bubble-duration: 44s;
  --bubble-path: home-bubble-path-b;
  left: 66vw;
  top: 70vh;
}
.bubble-10 {
  --bubble-size: 18px;
  --bubble-color: rgba(217, 111, 159, 0.36);
  --bubble-glow: rgba(217, 111, 159, 0.10);
  --bubble-delay: 0.5s;
  --bubble-duration: 40s;
  --bubble-path: home-bubble-path-a;
  left: 52vw;
  top: 48vh;
}
.profile-frame {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  animation: portrait-settle 900ms 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.about-media {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.about-media .social-buttons {
  justify-content: center;
  margin-top: 2rem;
}
.about .profile-pic {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}
/* Editorial homepage type: aesthetic serif, impactful display. */
.about h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.about .about-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
  color: var(--muted-foreground);
  margin: 0 0 2rem;
}
.mobile-subtitle-break {
  display: none;
}
.about .bio {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.5;
  text-wrap: balance;
  color: var(--foreground);
}
.about .bio em { font-style: italic; }
.about .bio a { text-decoration: underline; text-underline-offset: 3px; }
.about .bio .text-highlight-pink {
  color: var(--pink-strong);
  font-weight: 600;
}

@media (min-width: 821px) {
  .about .about-subtitle {
    white-space: nowrap;
  }
  .about-media {
    margin-top: 8rem;
  }
  .about-media .social-buttons {
    margin-top: 4rem;
  }
}

@media (max-width: 820px) {
  .about {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2rem;
    text-align: center;
    max-width: 760px;
    padding-top: 2rem;
  }
  .about-copy {
    display: contents;
  }
  .about-media {
    display: contents;
  }
  .profile-frame {
    grid-row: 1;
    width: min(330px, 84vw);
  }
  .about h1,
  .about .about-subtitle,
  .about .bio,
  .social-buttons {
    grid-column: 1;
  }
  .social-buttons {
    grid-row: 2;
    justify-content: center;
    margin-top: -0.9rem;
  }
  .about h1 {
    grid-row: 3;
    margin-bottom: 0;
  }
  .about .about-subtitle {
    grid-row: 4;
    margin-bottom: 0;
  }
  .about .bio {
    grid-row: 5;
    text-align: center;
  }
  .mobile-subtitle-break {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-home::before,
  .home-bubble,
  .profile-frame {
    animation: none;
    transform: none;
    opacity: 1;
  }
}

@keyframes home-bubble-pop {
  0% {
    opacity: 0;
    filter: blur(5px);
  }
  100% {
    opacity: 0.68;
    filter: blur(0);
  }
}
@keyframes home-bubble-path-a {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  42% {
    transform: translate3d(34vw, -18vh, 0) scale(1.08);
  }
  72% {
    transform: translate3d(12vw, 16vh, 0) scale(0.96);
  }
  100% {
    transform: translate3d(42vw, 4vh, 0) scale(1.04);
  }
}
@keyframes home-bubble-path-b {
  0% {
    transform: translate3d(0, 0, 0) scale(1.02);
  }
  36% {
    transform: translate3d(-26vw, 20vh, 0) scale(0.94);
  }
  70% {
    transform: translate3d(18vw, -14vh, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-34vw, 8vh, 0) scale(1);
  }
}
@keyframes home-bubble-path-c {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  44% {
    transform: translate3d(22vw, 24vh, 0) scale(1.1);
  }
  100% {
    transform: translate3d(-30vw, -12vh, 0) scale(0.95);
  }
}
@keyframes home-bubble-path-d {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  48% {
    transform: translate3d(18vw, -26vh, 0) scale(0.96);
  }
  100% {
    transform: translate3d(36vw, 12vh, 0) scale(1.06);
  }
}
@keyframes portrait-settle {
  0% {
    opacity: 0;
    transform: translate3d(0, -18px, 0) scale(0.94) rotate(-2deg);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0);
  }
}

/* --------------------------------------------------------- social buttons -- */

.social-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-top: 2.5rem;
}
.social-buttons .btn {
  width: 44px;
  padding: 0;
  justify-content: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 1.15rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.2s ease, opacity 0.15s ease, background 0.2s ease,
    border-color 0.2s ease;
}
.btn svg { width: 18px; height: 18px; }
/* Primary: blue-only gradient for colored social/action buttons. */
.btn-primary {
  border: 0;
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 58%, var(--periwinkle) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 131, 241, 0.22);
}
.btn-primary:hover { filter: brightness(1.04); text-decoration: none; }
.btn-primary:active { opacity: 0.8; }
.btn-outline {
  background: var(--card);
  color: var(--foreground);
  border-color: rgba(28, 28, 28, 0.4);
}
[data-theme="dark"] .btn-outline { border-color: rgba(255, 255, 255, 0.28); }
.btn-outline:hover { background: var(--muted); text-decoration: none; }
.btn-outline:active { opacity: 0.8; }
.btn-linkedin {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 62%, transparent);
}
.btn-mail {
  color: var(--pink-strong);
  border-color: color-mix(in srgb, var(--pink-strong) 62%, transparent);
}
/* ---------------------------------------------------------------- blog ----- */

.blog-tabs {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--muted) 52%, transparent);
}
.blog-tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted-foreground);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.blog-tab:hover {
  color: var(--foreground);
  background: var(--card);
  text-decoration: none;
}
.blog-tab.is-active {
  color: var(--blue-deep);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
.archive-toggle-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.archive-panel {
  display: none;
  margin-top: 0;
}
.archive-toggle {
  margin-bottom: 1.5rem;
}
#archive-classes:checked ~ .archive-toggle label[for="archive-classes"],
#archive-paper-reviews:checked ~ .archive-toggle label[for="archive-paper-reviews"] {
  color: var(--foreground);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
#archive-classes:checked ~ .archive-panel-classes,
#archive-paper-reviews:checked ~ .archive-panel-paper-reviews {
  display: block;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.post-list li {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.post-list li:last-child { border-bottom: none; }
.post-list .post-date {
  color: var(--muted-foreground);
  font-size: 0.85rem;
}
.post-list .post-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.post-meta {
  color: var(--muted-foreground);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------- footer ----- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 0.85rem;
}
.site-footer .container {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* -------------------------------------------------------------- motion ----- */

.fade-up { animation: fade-up 420ms ease-out both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* focus visibility: soft diffused glow + a thin ring for accessibility */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
