/* =====================================================
   DESIGN TOKENS
   Warm, editorial style for a personal research portfolio
===================================================== */

:root {
  color-scheme: light;

  --bg: #fbf8f3;
  --surface: #fffdf9;
  --surface-soft: #f3eee6;
  --ink: #282722;
  --muted: #68665e;
  --subtle: #89857b;
  --faint: #aaa49a;
  --line: #e5ded3;

  --accent: #a84f35;
  --accent-dark: #7e3827;
  --accent-soft: #f4e7df;
  --link: #87452f;
  --link-hover: #592c20;

  --shadow-sm: 0 4px 16px rgba(50, 37, 25, 0.045);
  --shadow-hover: 0 12px 28px rgba(50, 37, 25, 0.09);

  --radius-sm: 8px;
  --radius-md: 14px;
  --content-width: 54rem;
  --reading-width: 54rem;
}

/* =====================================================
   RESET & BASE
===================================================== */

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

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

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, rgba(244, 231, 223, 0.35), transparent 34rem),
    var(--bg);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 180ms ease, opacity 180ms ease;
}

a:hover {
  color: var(--link-hover);
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(168, 79, 53, 0.45);
  outline-offset: 4px;
  border-radius: 4px;
}

::selection {
  color: var(--ink);
  background: #f1d4c5;
}

/* =====================================================
   PAGE LAYOUT
===================================================== */

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

.wrap {
  max-width: 50rem;
  /* width: 50rem; */
  margin-inline: auto;
}
main.wrap {
  padding-top: clamp(2.4rem, 5vw, 4.25rem);
  padding-bottom: 5rem;
}

section {
  margin-bottom: clamp(2.7rem, 5vw, 4rem);
  scroll-margin-top: 6rem;
}

/* =====================================================
   HEADER & NAVIGATION
===================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 248, 243, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229, 222, 211, 0.85);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
  padding: 0.75rem 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}

.nav a:hover {
  color: var(--ink);
  background: var(--surface-soft);
  text-decoration: none;
}

.nav a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 650;
  text-decoration: none;
}

/* =====================================================
   TYPOGRAPHY
===================================================== */

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

h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

h2::after {
  content: "";
  width: 2.25rem;
  height: 2px;
  margin-left: auto;
  background: var(--accent);
  opacity: 0.65;
}

h3 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.42;
  letter-spacing: -0.012em;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

p:last-child,
ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

ul,
ol {
  padding-left: 1.35rem;
}

li + li {
  margin-top: 0.3rem;
}

strong,
b {
  font-weight: 650;
}

/* =====================================================
   IDENTITY / INTRODUCTION
===================================================== */

.identity {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.6rem);
  margin-bottom: clamp(2.5rem, 5vw, 3.75rem);
}

.identity h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.identity p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.identity .email {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(135, 69, 47, 0.35);
}

.identity .email:hover {
  text-decoration-color: currentColor;
}

/* =====================================================
   ABOUT
===================================================== */

.about-layout {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: clamp(1.4rem, 4vw, 2.5rem);
  align-items: start;
}

.about-photo img {
  display: block;
  width: 148px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(229, 222, 211, 0.9);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

#about p,
#research p {
  max-width: var(--reading-width);
  text-align: justify;
}

/* .highlight {
  padding: 0.08em 0.25em;
  border-radius: 0.25em;
  color: inherit;
  background: #f6e5a9;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
} */



/* =====================================================
   SOCIAL / PROFILE LINKS
===================================================== */

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--muted);
  text-decoration: none;
}

.social a:hover {
  border-color: #d6b6a7;
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-decoration: none;
}

/* =====================================================
   PUBLICATIONS
===================================================== */

.publication {
  position: relative;
  margin-bottom: 1.2rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.76);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.publication:hover {
  border-color: #d9c6b8;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.publication-year,
.project-year,
.award-year {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.publication h3 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.42;
}

.publication .authors,
.publication .venue {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.publication .authors {
  color: var(--muted);
}

.publication .venue {
  color: var(--subtle);
  font-style: italic;
}

/* =====================================================
   SECONDARY LINKS
===================================================== */

.publication-links,
.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-size: 0.82rem;
}

.publication-links a,
.project-links a {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(135, 69, 47, 0.3);
  text-underline-offset: 3px;
}

.publication-links a:hover,
.project-links a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.publication-links span,
.project-links span {
  color: var(--faint);
}

/* =====================================================
   PROJECTS
===================================================== */

.project {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
  margin-bottom: 1.35rem;
  padding: 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project:hover {
  border-color: var(--line);
  background: rgba(255, 253, 249, 0.82);
  box-shadow: var(--shadow-sm);
}

.project-image-link {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  text-decoration: none;
}

.project-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  filter: saturate(0.88);
  transition: transform 250ms ease, filter 250ms ease;
}

.project-image-link:hover .project-image {
  filter: saturate(1);
  transform: scale(1.035);
}

.project h3 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.42;
}

.project h3 a {
  color: var(--ink);
  text-decoration: none;
}

.project h3 a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-content p {
  max-width: 45rem;
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

/* =====================================================
   PROJECT DETAIL PAGE
===================================================== */

.project-page {
  width: min(100% - 2.5rem, var(--reading-width));
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 5rem;
}

.back-link {
  margin: 0 0 2.5rem;
  font-size: 0.88rem;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link a::before {
  content: "←";
  color: var(--accent);
}

.back-link a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.project-header {
  margin-bottom: 2.5rem;
}

.project-header h1 {
  max-width: 48rem;
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 750;
  line-height: 1.14;
  letter-spacing: -0.04em;
}

.project-subtitle {
  max-width: 40rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.project-hero {
  display: block;
  width: 100%;
  margin: 2rem 0 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.project-page section {
  max-width: var(--reading-width);
  padding: 0.5rem 0 1.6rem;
}

.project-page section h2 {
  margin-bottom: 1.1rem;
}

/* =====================================================
   VIDEO
===================================================== */

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.75rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #211f1c;
  box-shadow: var(--shadow-sm);
}

.video-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* =====================================================
   PROJECT GALLERY
===================================================== */

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.project-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 10rem;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

/* =====================================================
   AWARDS
===================================================== */

.award {
  margin-bottom: 1.2rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.76);
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.award:hover {
  border-color: #d9c6b8;
  box-shadow: var(--shadow-sm);
}

.award h3 {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.42;
}

.award-event,
.award-type {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.award-event {
  color: var(--muted);
}

.award-type {
  color: var(--subtle);
}

/* =====================================================
   NEWS
===================================================== */

.news {
  max-height: 24rem;
  overflow: auto;
  padding: 0.35rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.78);
  scrollbar-color: #c8b8a8 transparent;
  scrollbar-width: thin;
}

.news ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.news li:last-child {
  border-bottom: 0;
}

.news .when {
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* =====================================================
   ACCENT
===================================================== */

.mark {
  color: var(--accent-dark);
  font-weight: 700;
}

/* =====================================================
   RESPONSIVE & REDUCED MOTION
===================================================== */

@media (max-width: 700px) {
  .wrap {
    width: min(100% - 2rem, var(--content-width));
  }

  main.wrap {
    padding-top: 2.25rem;
  }

  .nav {
    width: calc(100% - 1rem);
    gap: 0.15rem;
    padding: 0.5rem 0;
  }

  .nav a {
    min-height: 2.2rem;
    padding: 0.4rem 0.65rem;
    font-size: 0.86rem;
  }

  .about-layout {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 1.15rem;
  }

  .about-photo img {
    width: 104px;
    border-radius: var(--radius-sm);
  }

  .identity {
    align-items: flex-start;
    gap: 1rem;
  }

  .identity h1 {
    font-size: clamp(1.8rem, 7vw, 2.35rem);
  }

  .project {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 1rem;
    padding: 0.8rem;
  }

  .project-content p {
    font-size: 0.9rem;
  }

  .project-page {
    width: min(100% - 2rem, var(--reading-width));
  }

  .project-header h1 {
    font-size: clamp(1.9rem, 7vw, 2.5rem);
  }

  .project-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 460px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-photo img {
    width: 96px;
  }

  .identity {
    align-items: flex-start;
  }

  .project {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .project-image-link {
    max-width: 100%;
  }

  .project-image {
    aspect-ratio: 16 / 9;
  }

  .project-gallery {
    grid-template-columns: 1fr;
  }

  .news li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .publication,
  .award {
    padding: 1rem;
  }
}

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