/* ============================================================
   FONTS
   ============================================================ */
@font-face {
  font-family: 'November Sky';
  src: local('November Sky'),
       url('../fonts/NovemberSky.woff2') format('woff2'),
       url('../fonts/NovemberSky.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   CUSTOM PROPERTIES (LIGHT THEME)
   ============================================================ */
:root {
  --bg: #e9e4d2;
  --paper: #f1ead5;
  --ink: #11110f;
  --muted: #6c675d;
  --line: rgba(20, 18, 14, 0.24);
  --accent: #ef6758;
  --accent2: #bd9a2e;
  --card: rgba(255, 248, 226, 0.46);
  --shadow: 0 26px 90px rgba(45, 34, 16, 0.14);
  --mono: "Courier New", monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --serif: 'Libre Baskerville', Georgia, serif;
  --script: 'November Sky', 'Mea Culpa', 'Libre Baskerville', serif;
}

/* Dark theme overrides */
html[data-theme='dark'] {
  --bg: #10100e;
  --paper: #171611;
  --ink: #f3ead5;
  --muted: #b8ad95;
  --line: rgba(240, 230, 205, 0.16);
  --accent: #ff7668;
  --accent2: #d6a83a;
  --card: rgba(255, 242, 208, 0.06);
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.36);
}

/* ============================================================
   GLOBAL RESETS & BASE
   ============================================================ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  overflow-x: hidden;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

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

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

/* ============================================================
   TEXTURE & DECORATIVE ELEMENTS
   ============================================================ */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.27'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.side-rail {
  position: fixed;
  top: 35vh;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.34em;
  color: var(--muted);
  z-index: 8;
  writing-mode: vertical-rl;
  text-transform: uppercase;
}

.side-rail.left {
  left: 10px;
}

.side-rail.right {
  right: 10px;
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.ticker {
  max-width: 1320px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

.ticker b,
.live-dot {
  color: var(--accent);
}

.nav-wrap {
  max-width: 1350px;
  margin: auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink);
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font: 700 18px/1 var(--serif);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  font: 600 13px/1 var(--sans);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


.socials{display:flex;gap:8px}.socials a,.icon-btn{width:38px;height:38px;border-radius:50%;border:1px solid var(--line);display:grid;place-items:center;background:var(--card);box-shadow:0 2px 16px rgba(0,0,0,.03)}.socials svg{width:18px;height:18px;fill:var(--ink)}.icon-btn{color:var(--ink);cursor:pointer;font-weight:700}

.socials a,
.icon-btn{width:38px;height:38px;border-radius:50%;border:1px solid var(--line);display:grid;place-items:center;background:var(--card);box-shadow:0 4px 18px rgba(0,0,0,.04);overflow:hidden}.socials img{width:23px;height:23px;object-fit:contain;display:block}.icon-btn{color:var(--ink);cursor:pointer}.icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.lang-btn {
  width: auto;
  border-radius: 999px;
  padding: 0 12px;
  font: 700 11px/1 var(--mono);
}

/* Theme toggle visibility */
html[data-theme='light'] .moon,
html[data-theme='dark'] .sun {
  display: none;
}

/* Language toggle */
/* Language toggle – fixed for all contexts including news */
.zh,
.news-list p span.zh,
.time-item p span.zh,
.card p span.zh,
.pub p span.zh {
  display: none !important;
}

body.lang-zh .en,
body.lang-zh .news-list p span.en,
body.lang-zh .time-item p span.en,
body.lang-zh .card p span.en,
body.lang-zh .pub p span.en {
  display: none !important;
}

body.lang-zh .zh,
body.lang-zh .news-list p span.zh,
body.lang-zh .time-item p span.zh,
body.lang-zh .card p span.zh,
body.lang-zh .pub p span.zh {
  display: inline !important;
}

/* ============================================================
   SECTION FRAME (reusable container with corner decorations)
   ============================================================ */
.section-frame {
  max-width: 1180px;
  margin: 48px auto;
  padding: 52px 56px;
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-frame::before,
.section-frame::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--line);
  border-style: solid;
}

.section-frame::before {
  top: -1px;
  left: 0;
  border-width: 1px 0 0 1px;
}

.section-frame::after {
  bottom: -1px;
  right: 0;
  border-width: 0 1px 1px 0;
}

.plate-top,
.plate-bottom {
  position: absolute;
  left: 56px;
  right: 56px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.plate-top {
  top: 22px;
}

.plate-bottom {
  bottom: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  min-height: 730px;
  display: grid;
  grid-template-columns: 0.9fr 1.05fr;
  gap: 52px;
  align-items: center;
}

.eyebrow {
  font: 700 12px/1.2 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 14px;
}

.line {
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--accent);
}

.name-script {
  font-family: var(--script);
  font-size: clamp(52px, 6.8vw, 75px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: 0.015em;
  display: block;
  text-wrap: balance;
}

.hero h2,
.big-heading {
  font-size: clamp(36px, 4.4vw, 70px);
  letter-spacing: -0.055em;
  line-height: 0.93;
  margin: 18px 0 24px;
  font-weight: 900;
}

.big-heading .en {
  display: inline;
}

.hero h2 em,
.big-heading em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
}

.hero-text {
  font-size: 18px;
  max-width: 560px;
  text-align: justify;
  color: var(--muted);
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.btn.primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

.show-more {
  margin: 24px auto 0;
  display: flex;
  background: var(--accent);
}

/* Micro stats (inline pill badges) */
.micro-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
  margin-bottom: 18px;
  position: relative;
  z-index: 4;
}

.micro-stats span {
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: 12px 14px;
  font: 700 11px/1.15 var(--mono);
  text-transform: uppercase;
  /* Allow Chinese text to wrap inside badges */
  white-space: normal;
  word-break: keep-all;
}

.micro-stats b {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--accent);
}

.hero-art {
  position: relative;
  min-height: 520px;
  background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.hero-art img {
  max-height: 520px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: contrast(1.06) saturate(1.08) brightness(1.03);
  position: relative;
  z-index: 1;
}

.hero-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 65%, color-mix(in srgb, var(--bg) 72%, transparent));
  z-index: 2;
  pointer-events: none;
}

html[data-theme='dark'] .hero-art img {
  opacity: 0.92;
  filter: contrast(1.08) saturate(1.05) brightness(0.92);
}

/* Decorative abstract shapes */
.sun-disc {
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.78;
  left: 9%;
  top: 10%;
  z-index: -1;
}

.gold-disc {
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--accent2);
  right: 18%;
  bottom: 18%;
}

.grid-dots {
  position: absolute;
  right: 12%;
  top: 11%;
  width: 190px;
  height: 160px;
  background-image: radial-gradient(var(--muted) 1.1px, transparent 1.2px);
  background-size: 15px 15px;
  opacity: 0.7;
}

.cloud {
  position: absolute;
  background: #e4dfcf;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.85;
}

.cloud-a {
  width: 200px;
  height: 58px;
  left: 8%;
  top: 48%;
}

.cloud-b {
  width: 170px;
  height: 52px;
  right: 6%;
  bottom: 32%;
}

.cube-stack {
  position: absolute;
  left: 16%;
  bottom: 25%;
  width: 88px;
  height: 88px;
  background: linear-gradient(45deg, transparent 48%, var(--ink) 49%, var(--ink) 51%, transparent 52%);
  opacity: 0.18;
}

.paper-rock {
  position: absolute;
  right: -6%;
  bottom: -8%;
  width: 300px;
  height: 210px;
  background: #888;
  clip-path: polygon(0 35%, 100% 0, 94% 100%, 8% 86%);
  opacity: 0.28;
}

.art-label {
  position: absolute;
  right: 28px;
  top: 18px;
  font: italic 26px/1 var(--serif);
  color: var(--muted);
}

/* ============================================================
   FIELD STRIP (horizontal scrollable tagline)
   ============================================================ */
.field-strip {
  max-width: 1180px;
  margin: 34px auto;
  padding: 24px 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  white-space: nowrap;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.field-title {
  color: var(--ink);
  padding-right: 28px;
  border-right: 1px solid var(--line);
}

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */
.two-col {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 64px;
}

.body-copy {
  font-size: 18px;
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.tag-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font: 700 12px/1 var(--mono);
  color: var(--ink);
  background: var(--card);
  white-space: nowrap;
}

/* Allow tag list items to wrap on mobile */
@media (max-width: 680px) {
  .tag-list li {
    white-space: normal;
  }
}

/* ============================================================
   CARDS
   ============================================================ */
.cards {
  display: grid;
  gap: 18px;
}

.cards.four {
  grid-template-columns: repeat(4, 1fr);
}

.cards.three {
  grid-template-columns: repeat(3, 1fr);
}

.cards.two {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  /* Remove fixed min-height to accommodate longer Chinese text */
  min-height: auto;
  box-shadow: var(--shadow);
}

.card .num {
  font: italic 18px/1 var(--serif);
  color: var(--accent);
}

.card h3 {
  font-size: 24px;
  line-height: 1.2; /* Slightly increased for CJK characters */
  margin: 28px 0 12px;
  letter-spacing: -0.04em;
}

.card p {
  color: var(--muted);
  margin: 0;
}

/* Statement & service strips */
.statement-strip,
.service-grid {
  margin-top: 26px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 20px;
}

/* ============================================================
   SPLIT LIST + TIMELINE
   ============================================================ */
.split-list {
  display: grid;
  grid-template-columns: 0.38fr 1fr;
  gap: 46px;
}

.split-list h2 {
  font-size: 52px;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

/* ============================================================
   TIMELINE (Education & Experience) – FIXED FOR CHINESE SPANS
   ============================================================ */
.timeline {
  border-left: 1px solid var(--line);
}

.time-item {
  padding: 0 0 28px 28px;
  text-align: justify;
  position: relative;
}

.time-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
}

/* Target ONLY the date span (the direct child span inside .time-item) */
.time-item > span {
  font: 700 12px/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

/* Heading inside time-item – normal font, no forced monospace/orange */
.time-item h3 {
  font-size: 24px;
  line-height: 1.2;
  margin: 8px 0;
  font-family: var(--sans);
  color: var(--ink);
  word-break: break-word;
}

/* Any spans inside h3 (e.g., .en, .zh) inherit heading style */
.time-item h3 span {
  font: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
}

/* Paragraph inside time-item – normal style */
.time-item p {
  color: var(--muted);
  margin: 0;
  font-family: var(--sans);
  line-height: 1.55;
  word-break: break-word;
}

/* Any spans inside p (e.g., .en, .zh) inherit paragraph style */
.time-item p span {
  font: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
}

/* Utility widths */
.wide {
  min-height: auto; /* override for Chinese */
}

.small {
  font-size: clamp(38px, 4vw, 62px);
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.pub-list {
  display: grid;
  gap: 24px;
}

.pub {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.pub.has-img {
  grid-template-columns: 0.88fr 0.72fr;
  align-items: center;
}

.pub h3 {
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 8px 0;
  word-break: break-word;
}

.pub p {
  color: var(--muted);
  word-break: break-word;
}

.pub img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--line);
  padding: 10px;
}

.tldr {
  font-family: 'IBM Plex Mono';
  font-size: 14px;
}

.more-pub {
  display: none;
}

.pub-list.show-all .more-pub {
  display: grid;
}

.patent img {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
}

/* ============================================================
   SERVICES & NEWS
   ============================================================ */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

/* ============================================================
   NEWS SECTION – FIXED FOR CHINESE SPANS
   ============================================================ */
.news-list {
  border-top: 1px solid var(--line);
}

.news-list > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

/* Target ONLY the date span (first child of each news div) */
.news-list > div > span {
  font: 700 13px/1 var(--mono);
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}

/* Paragraph text – keeps normal font and muted colour */
.news-list p {
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  line-height: 1.55;
  word-break: break-word;
}

/* Any spans inside .news-list p (e.g., .en, .zh) should inherit paragraph styles */
.news-list p span {
  font: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: normal;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 46px;
  align-items: center;
}

.contact-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  max-width: 1180px;
  margin: 50px auto 80px;
  padding: 28px 56px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font: 600 12px/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ============================================================
   RESPONSIVE – TABLET
   ============================================================ */
@media (max-width: 1050px) {
  .hero,
  .two-col,
  .split-list,
  .contact {
    grid-template-columns: 1fr;
  }

  .cards.four,
  .cards.three,
  .cards.two {
    grid-template-columns: 1fr 1fr;
  }

  .nav-wrap {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .side-rail {
    display: none;
  }

  .section-frame {
    margin: 26px 16px;
    padding: 42px 24px;
  }

  .plate-top,
  .plate-bottom {
    left: 24px;
    right: 24px;
  }

  .pub.has-img {
    grid-template-columns: 1fr;
  }

  /* Adjust news grid on tablet */
  .news-list > div {
    grid-template-columns: 120px 1fr;
    gap: 20px;
  }
  
  .socials a,
  .icon-btn {
    place-items:center;
  }
}

/* ============================================================
   RESPONSIVE – MOBILE
   ============================================================ */
@media (max-width: 680px) {
  .ticker {
    display: none;
  }

  .cards.four,
  .cards.three,
  .cards.two,
  .service-grid,
  .news-list > div {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .name-script {
    font-size: 66px;
  }

  .hero h2,
  .big-heading {
    font-size: 44px;
  }

  .top-actions {
    width: 100%;
    justify-content: center;
  }
  
   .plate-bottom {
    display: none;
  }

  .socials a,
  .icon-btn {
    width: 36px;
    height: 36px;
    place-items:center;
  }

  .hero-art {
    min-height: 380px;
  }

  .footer {
    margin: 30px 16px;
    padding: 22px;
    flex-direction: column;
  }

  .nav-wrap {
    padding: 14px;
  }

  .nav-links {
    font-size: 12px;
    gap: 14px;
  }

  /* Make news date and content stack on mobile */
  .news-list > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .news-list span {
    display: inline-block;
    margin-bottom: 6px;
  }
}

/* ============================================================
   V3 REFINEMENTS
   OpenDesign-style top metadata, compact top contact, 
   stronger photo display
   ============================================================ */

/* Refined brand text (hides mark, shows text-only pill) */
.brand-text-only {
  font: 800 15px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.brand-mark {
  display: none;
}

/* Top action pills */
.top-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-pill {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  box-shadow: 0 8px 25px rgba(0,0,0,0.04);
  white-space: nowrap;
}

.top-pill:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  color: var(--accent);
}

.email-copy {
  cursor: pointer;
}

.email-copy .email-label {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--muted);
}

.copy-mini {
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
}

.inline-copy {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  padding: 8px 12px;
  color: var(--ink);
  cursor: pointer;
  font: 700 13px/1 var(--mono);
}

.inline-copy span {
  margin-left: 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 10px;
}

/* Design ledger (top metadata strip) */
.design-ledger {
  max-width: 1180px;
  margin: 20px auto 0;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  overflow: hidden;
  white-space: nowrap;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.design-ledger b,
.design-ledger .accent {
  color: var(--accent);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 14px 0 0 color-mix(in srgb, var(--ink) 35%, transparent);
}

/* Hero extended decorations */
.hero-copy {
  position: relative;
  z-index: 3;
}

.hero-copy::after {
  display: block;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font: 700 11px/1.8 var(--mono);
  letter-spacing: 0.13em;
  color: var(--muted);
}

.hero-art {
  border-radius: 2px;
}

.hero-art:before {
  content: '';
  position: absolute;
  inset: 22px;
  border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent);
  z-index: 3;
  pointer-events: none;
}

/* Plate accent colors */
.plate-top span:last-child,
.plate-bottom span:last-child {
  color: var(--accent);
}

/* Abstract shapes stay behind */
.sun-disc,
.gold-disc,
.grid-dots,
.cloud,
.cube-stack,
.paper-rock {
  z-index: 0;
}

.art-label {
  z-index: 4;
}

/* Section frame subtle gradient background */
.section-frame {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--card) 35%, transparent));
}

.section-frame .eyebrow::after {
  content: '·';
  color: var(--accent);
  margin-left: 2px;
}

/* Contact card paragraph spacing */
.contact-card p:first-child {
  margin-top: 0;
}

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

.contact-card p {
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
  margin-bottom: 14px;
}

.contact-card p:last-child {
  border-bottom: 0;
}

/* Footer decorative dot */
.footer span:first-child::before {
  content: '● ';
  color: var(--accent);
}

/* ============================================================
   FIX: Ensure journal name/year appears in monospace (venue)
   ============================================================ */
.pub .venue {
  font: 700 12px/1 var(--mono) !important;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 8px;
}

/* ============================================================
   V3 RESPONSIVE – TABLET
   ============================================================ */
@media (max-width: 1050px) {
  .design-ledger {
    grid-template-columns: 1fr;
  }
  
  .design-ledger {
    padding: 18px 24px;
  }

  .design-ledger > div {
    flex-wrap: wrap;
  }

  .top-actions {
    justify-content: flex-wrap;
  }

  .email-copy .email-label {
    width: 100%;
    text-align: center;
  }

  .hero::before {
    display: none;
  }

    .hero,
  .two-col,
  .split-list,
  .contact {
    grid-template-columns: 1fr;
  }

  .cards.four,
  .cards.three,
  .cards.two {
    grid-template-columns: 1fr 1fr;
  }

  .nav-wrap {
    flex-wrap: wrap;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .side-rail {
    display: none;
  }

  .section-frame {
    margin: 26px 16px;
    padding: 42px 24px;
  }

  .plate-top,
  .plate-bottom {
    left: 24px;
    right: 24px;
  }

  .news-list > div {
    grid-template-columns: 120px 1fr;
    gap: 20px;
  }
  
  /* ✅ FIXED: proper alignment for top actions */
  .top-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  
  .socials a,
  .icon-btn {
    place-items: center;
  }
  
  .side-rail {
    display: none;
  }
  .pub.has-img,
  .pub.more-pub,
  .patent-card {
    grid-template-columns: 1fr;
  }
  .portrait {
    width: 64%;
  }
}

/* ============================================================
   V3 RESPONSIVE – MOBILE
   ============================================================ */
@media (max-width: 680px) {
  .ticker {
    display: none;
  }

  .cards.four,
  .cards.three,
  .cards.two,
  .service-grid,
  .news-list > div {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero h2,
  .big-heading {
    font-size: 44px;
  }

  /* ✅ FIXED: center the entire top actions group on mobile */
  .top-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .plate-bottom {
    display: none;
  }

  .socials a,
  .icon-btn {
    width: 36px;
    height: 36px;
    place-items: center;
  }

  .hero-art {
    min-height: 380px;
  }

  .footer {
    margin: 30px 16px;
    padding: 22px;
    flex-direction: column;
  }

  .nav-wrap {
    padding: 14px;
  }

  .nav-links {
    font-size: 12px;
    gap: 14px;
  }

  .news-list > div {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .news-list span {
    display: inline-block;
    margin-bottom: 6px;
  }
  
  .name-script {
    font-size: 66px;
  }

  .top-pill.explore-top {
    display: none;
  }

  .email-copy {
    width: 100%;
    text-align: center;
  }

  .copy-mini {
    padding: 5px 6px;
  }
  
  .lang-btn {
    width: 90px;
    text-align: center;
  }
  
  .field-strip {
    display: none;
  }

  .design-ledger {
    display: none;
  }
  
  .side-rail {
    display: none;
  }

  .hero-copy::after {
    font-size: 9px;
  }

  .hero::after {
    display: none;
  }
}

/* ============================================================
   V5 SUBTLE MOTION & INTERACTION LAYER
   ============================================================ */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.2, .8, .2, 1);
  --motion-fast: 180ms;
  --motion-med: 420ms;
  --motion-slow: 760ms;
}

body {
  transition: background-color var(--motion-med) var(--ease-out), color var(--motion-med) var(--ease-out);
}

.site-header {
  transition: padding var(--motion-med) var(--ease-out), background-color var(--motion-med) var(--ease-out), box-shadow var(--motion-med) var(--ease-out), border-color var(--motion-med) var(--ease-out);
}

body.is-scrolled .site-header {
  box-shadow: 0 14px 45px rgba(22, 18, 12, 0.08);
  border-color: color-mix(in srgb, var(--line) 72%, var(--accent));
}

body.is-scrolled .nav-wrap {
  padding-top: 12px;
  padding-bottom: 12px;
}

.nav-wrap {
  transition: padding var(--motion-med) var(--ease-out);
}

.nav-links a,
.brand-text-only,
.btn,
.top-pill,
.socials a,
.icon-btn,
.inline-copy,
.card,
.pub,
.pub img,
.tag-list li,
.micro-stats span,
.contact-card,
.hero-art,
.field-strip span,
.news-list > div,
.time-item {
  transition:
    transform var(--motion-med) var(--ease-out),
    box-shadow var(--motion-med) var(--ease-out),
    border-color var(--motion-med) var(--ease-out),
    background-color var(--motion-med) var(--ease-out),
    color var(--motion-med) var(--ease-out),
    opacity var(--motion-med) var(--ease-out),
    filter var(--motion-med) var(--ease-out);
}

.nav-links a {
  position: relative;
  padding: 8px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--motion-med) var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-links a.active {
  color: var(--accent);
}

.brand-text-only:hover {
  transform: translateX(4px);
  border-left-color: var(--ink);
}

.btn,
.top-pill,
.icon-btn,
.inline-copy,
.socials a {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn:hover,
.top-pill:hover,
.inline-copy:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(42, 31, 14, 0.14);
}

.btn:active,
.top-pill:active,
.icon-btn:active,
.inline-copy:active,
.socials a:active {
  transform: translateY(0) scale(0.97);
}

.btn.primary:hover {
  filter: saturate(1.08) brightness(1.02);
}

.socials a:hover,
.icon-btn:hover {
  transform: translateY(-3px) rotate(-2deg);
  border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  background: color-mix(in srgb, var(--card) 70%, var(--accent) 10%);
}

.socials a:hover svg,
.icon-btn:hover svg {
  transform: scale(1.08);
}

.socials svg,
.icon-btn svg {
  transition: transform var(--motion-med) var(--ease-out), stroke var(--motion-med) var(--ease-out), fill var(--motion-med) var(--ease-out);
}

.ripple {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.18;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  animation: ripple-pulse 620ms var(--ease-out) forwards;
  z-index: -1;
}

@keyframes ripple-pulse {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(16);
  }
}

.section-frame,
.field-strip,
.design-ledger {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--motion-slow) var(--ease-out), transform var(--motion-slow) var(--ease-out), background-color var(--motion-med) var(--ease-out);
}

.section-frame.is-visible,
.field-strip.is-visible,
.design-ledger.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-frame:hover {
  border-color: color-mix(in srgb, var(--line) 70%, var(--accent));
}

.section-frame:hover::before,
.section-frame:hover::after {
  border-color: color-mix(in srgb, var(--line) 55%, var(--accent));
}

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
  box-shadow: 0 28px 70px rgba(36, 25, 12, 0.16);
}

.card:hover .num {
  color: var(--ink);
}

.pub:hover,
.news-list > div:hover,
.time-item:hover {
  transform: translateX(5px);
}

.pub.has-img:hover img {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 18px 42px rgba(20, 14, 7, 0.14);
}

.tag-list li:hover,
.micro-stats span:hover {
  transform: translateY(-3px);
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--card) 70%, var(--accent) 10%);
}

.micro-stats span:hover b {
  color: var(--ink);
}

.hero-art {
  transform-style: preserve-3d;
  will-change: transform;
}

.hero-art:hover {
  box-shadow: 0 32px 90px rgba(42, 31, 14, 0.18);
}

.hero-art img {
  transition: transform 900ms var(--ease-out), filter var(--motion-med) var(--ease-out), opacity var(--motion-med) var(--ease-out);
}

.hero-art:hover img {
  transform: scale(1.025);
}

.sun-disc,
.gold-disc,
.grid-dots,
.cloud,
.cube-stack,
.paper-rock {
  transition: transform 900ms var(--ease-out), opacity var(--motion-med) var(--ease-out);
}

.hero-art:hover .sun-disc { transform: translate3d(-8px, -7px, 0) scale(1.03); }
.hero-art:hover .gold-disc { transform: translate3d(8px, -8px, 0) scale(1.08); }
.hero-art:hover .grid-dots { transform: translate3d(8px, 5px, 0); }
.hero-art:hover .cloud-a { transform: translate3d(-10px, 2px, 0); }
.hero-art:hover .cloud-b { transform: translate3d(8px, -2px, 0); }

.field-strip span:not(.field-title):hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.eyebrow .line {
  transform-origin: left;
  animation: line-breathe 3.8s var(--ease-out) infinite;
}

@keyframes line-breathe {
  0%, 100% { transform: scaleX(1); opacity: .8; }
  50% { transform: scaleX(1.45); opacity: 1; }
}

.theme-flash::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 42%);
  pointer-events: none;
  z-index: 999;
  animation: theme-flash 700ms var(--ease-out) forwards;
}

@keyframes theme-flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, var(--ink) 6%);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(25, 18, 8, 0.18);
  font: 700 12px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity var(--motion-med) var(--ease-out), transform var(--motion-med) var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.copy-done {
  border-color: color-mix(in srgb, var(--accent) 68%, var(--line)) !important;
  background: color-mix(in srgb, var(--card) 70%, var(--accent) 13%) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .section-frame,
  .field-strip,
  .design-ledger {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (max-width: 680px) {
  .toast {
    right: 16px;
    bottom: 16px;
  }
  .pub:hover,
  .news-list > div:hover,
  .time-item:hover {
    transform: none;
  }
}
