/* ===========================
   Tokens — editorial magazine
   =========================== */
:root {
  /* Color */
  --paper: #f4efe6;
  --paper-2: #ebe5d7;
  --white: #fdfaf3;
  --ink: #1a1612;
  --ink-2: #2a2520;
  --ink-3: #3d3833;
  --stone: #6a635b;
  --ash: #9a9389;
  --line: rgba(26, 22, 18, 0.12);
  --line-soft: rgba(26, 22, 18, 0.06);
  --vermillion: #c84431;
  --vermillion-soft: #e07a5f;
  --moss: #4a5d3a;

  /* Type */
  --font-display: 'Fraunces', 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
  --font-body: 'IBM Plex Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Menlo', 'Consolas', monospace;

  /* Spacing scale (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Type scale */
  --t-xs: 0.7rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.375rem;
  --t-xl: 2rem;
  --t-2xl: 3rem;
  --t-3xl: 4.5rem;
  --t-4xl: 7rem;
}

/* ===========================
   Reset & base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  padding-top: 64px;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(200, 68, 49, 0.04), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(74, 93, 58, 0.04), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.35  0 0 0 0 0.3  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

p {
  max-width: 65ch;
}

::selection {
  background: var(--vermillion);
  color: var(--paper);
}

/* ===========================
   Layout
   =========================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}

/* ===========================
   Nav
   =========================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 64px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav-brand .brand-mark {
  color: var(--vermillion);
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
  padding: var(--s-2) var(--s-4);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--vermillion);
}

.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-toggle::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  min-width: 160px;
  list-style: none;
  padding: var(--s-2) 0;
  z-index: 1001;
  box-shadow: 0 8px 24px rgba(26, 22, 18, 0.08);
}

.dropdown-menu a {
  font-size: var(--t-sm);
  letter-spacing: 0.06em;
  padding: var(--s-2) var(--s-4);
  display: block;
  color: var(--ink-2);
}

.dropdown-menu a:hover {
  background: var(--paper);
  color: var(--vermillion);
}

.dropdown.open .dropdown-menu {
  display: block;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ===========================
   Hero — editorial masthead
   =========================== */
.hero {
  padding: var(--s-9) 0 var(--s-8);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.masthead {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--stone);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--s-4);
  margin-bottom: var(--s-7);
  border-bottom: 1px solid var(--line);
}

.masthead .vol {
  color: var(--vermillion);
  font-weight: 500;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, var(--t-4xl));
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: var(--s-5);
  font-variation-settings: "opsz" 144;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--vermillion);
}

.hero-dek {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 600px;
  margin-bottom: var(--s-7);
}

.editor-note {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s-6);
  align-items: start;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.editor-note-label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--vermillion);
  padding-top: 6px;
}

.editor-note-text {
  font-size: var(--t-md);
  line-height: 1.7;
  color: var(--ink-2);
  max-width: none;
}

.editor-note-text strong {
  color: var(--ink);
  font-weight: 600;
}

/* ===========================
   Year section — magazine spread
   =========================== */
.year-section {
  padding: var(--s-9) 0 var(--s-7);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.year-section:last-of-type {
  border-bottom: none;
}

.year-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2px 2fr;
  gap: var(--s-6);
  align-items: start;
  margin-bottom: var(--s-7);
}

.year-num {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 11vw, 9rem);
  font-weight: 300;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--ink);
  font-variation-settings: "opsz" 144;
  position: relative;
}

.year-num::before {
  content: "VOL.";
  position: absolute;
  top: -10px;
  left: 0;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--vermillion);
}

.year-rule {
  width: 1px;
  background: var(--ink);
  height: 100%;
  align-self: stretch;
}

.year-meta {
  padding-top: var(--s-3);
}

.year-meta h2 {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 500;
  font-style: italic;
  color: var(--ink-2);
  margin-bottom: var(--s-4);
  line-height: 1.4;
}

.year-meta .disciplines {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--vermillion);
  margin-bottom: var(--s-3);
  display: block;
}

.teacher-note {
  font-size: var(--t-base);
  line-height: 1.7;
  color: var(--ink-3);
  max-width: 60ch;
}

.teacher-note strong {
  color: var(--ink);
  font-weight: 600;
}

/* ===========================
   Gallery — 4 columns
   =========================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-4);
}

/* ===========================
   Card — flat, equal height
   =========================== */
.card {
  display: flex;
  min-height: 420px;
}

.card-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: var(--s-5) var(--s-3) var(--s-4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
}

.card-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--ink);
  opacity: 0;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.card-link:hover {
  border-color: var(--vermillion);
  box-shadow: 0 6px 20px rgba(26, 22, 18, 0.08);
  transform: translateY(-2px);
}

.card-link:hover::before {
  opacity: 1;
  background: var(--vermillion);
}

.card-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(26, 22, 18, 0.08);
  flex-shrink: 0;
  margin-bottom: var(--s-3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-link:hover .card-avatar {
  transform: scale(1.04);
  box-shadow: 0 4px 12px rgba(26, 22, 18, 0.14);
}

.card-front-designer {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone);
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-front-designer::before {
  content: "— ";
  color: var(--vermillion);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin-top: var(--s-3);
  font-variation-settings: "opsz" 36;
  max-width: 100%;
}

.card-title::after {
  content: "";
  display: block;
  width: 22px;
  height: 1px;
  background: var(--vermillion);
  margin: 8px auto 0;
}

.card-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--stone);
  margin-top: var(--s-3);
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  flex: 1;
}

/* Placeholder card */
.card-placeholder .card-link {
  background: var(--paper-2);
  border-style: dashed;
  cursor: default;
}

.card-placeholder .card-link:hover {
  border-color: var(--ash);
  transform: none;
  box-shadow: none;
}

.card-placeholder .card-link::before {
  display: none;
}

.card-placeholder .card-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ash);
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 300;
  border: 1px dashed var(--ash);
  box-shadow: none;
}

.card-placeholder .card-front-designer {
  color: var(--ash);
}

.card-placeholder .card-title {
  color: var(--stone);
}

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

/* ===========================
   Footer
   =========================== */
footer {
  background: var(--ink);
  color: rgba(244, 239, 230, 0.7);
  padding: var(--s-8) 0 var(--s-6);
  margin-top: var(--s-7);
  font-size: var(--t-sm);
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--vermillion);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s-7);
  margin-bottom: var(--s-6);
}

.footer-title {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-style: italic;
  color: var(--paper);
  margin-bottom: var(--s-3);
  font-weight: 400;
}

.footer-text {
  font-size: var(--t-sm);
  line-height: 1.7;
  color: rgba(244, 239, 230, 0.6);
  max-width: 360px;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--vermillion);
  margin-bottom: var(--s-3);
  font-weight: 500;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--s-2);
}

.footer-col a {
  color: rgba(244, 239, 230, 0.7);
  font-size: var(--t-sm);
}

.footer-col a:hover {
  color: var(--vermillion-soft);
}

.footer-bottom {
  border-top: 1px solid rgba(244, 239, 230, 0.1);
  padding-top: var(--s-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(244, 239, 230, 0.4);
}

/* ===========================
   Back to top
   =========================== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(26, 22, 18, 0.2);
  transition: background 0.2s, transform 0.2s;
  z-index: 999;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  background: var(--vermillion);
  transform: translateY(-2px);
}

/* ===========================
   Mobile nav
   =========================== */
.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--paper);
  padding: var(--s-4) var(--s-5) var(--s-5);
  z-index: 999;
  border-bottom: 1px solid var(--line);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line-soft);
}

.mobile-nav a:last-child { border-bottom: none; }

.mobile-nav a:hover {
  color: var(--vermillion);
}

.mobile-nav .mobile-year-label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--vermillion);
  padding: var(--s-4) 0 var(--s-2);
  border-bottom: none;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-4);
  }

  .card {
    min-height: 400px;
  }

  .card-avatar,
  .card-placeholder .card-avatar {
    width: 130px;
    height: 130px;
  }

  .year-header {
    grid-template-columns: minmax(140px, 1fr) 2px 2fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-5);
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero {
    padding: var(--s-7) 0 var(--s-6);
  }

  .editor-note {
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }

  .year-section {
    padding: var(--s-7) 0 var(--s-6);
  }

  .year-header {
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }

  .year-rule {
    display: none;
  }

  .year-num {
    font-size: 4rem;
  }

  .year-num::before {
    position: static;
    display: block;
    margin-bottom: var(--s-2);
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-3);
  }

  .card {
    min-height: 380px;
  }

  .card-avatar,
  .card-placeholder .card-avatar {
    width: 120px;
    height: 120px;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .card-desc {
    font-size: 0.9rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--s-5);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--s-2);
    text-align: center;
  }
}

@media (max-width: 400px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-2);
  }

  .card {
    min-height: 360px;
  }

  .card-avatar,
  .card-placeholder .card-avatar {
    width: 100px;
    height: 100px;
  }

  .card-desc {
    font-size: 0.85rem;
  }

  .card-link {
    padding: var(--s-3) var(--s-2);
  }

  .card-front-designer {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  .card-title {
    font-size: 1rem;
  }

  .card-desc {
    font-size: 0.85rem;
    -webkit-line-clamp: 3;
  }
}

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

/* ===========================
   Focus visible
   =========================== */
:focus-visible {
  outline: 2px solid var(--vermillion);
  outline-offset: 3px;
  border-radius: 2px;
}
