/* Shared tokens and base styles. Pages load fonts and styles directly in <head>. */

:root {
  --color-bg: #f3eadd;
  --color-surface: #faf5ea;
  --color-text: #252b31;
  --color-accent: #b7862f;
  --color-heading: #155c63;
  --color-divider: #c7b9a0;
  --persian-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23155c63' stroke-opacity='.045' stroke-width='1'%3E%3Cpath d='M48 0L96 48L48 96L0 48Z'/%3E%3Cpath d='M48 16L53.4 35.1L70.6 25.4L60.9 42.6L80 48L60.9 53.4L70.6 70.6L53.4 60.9L48 80L42.6 60.9L25.4 70.6L35.1 53.4L16 48L35.1 42.6L25.4 25.4L42.6 35.1Z'/%3E%3C/g%3E%3Ccircle cx='48' cy='48' r='1.2' fill='%23b7862f' fill-opacity='.10'/%3E%3C/svg%3E");
  --color-accent-100: #f7e8c7;
  --color-accent-600: #9b7024;
  --color-accent-700: #76531e;
  --color-accent-800: #543a16;
  --font-heading: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --space-1: 4.6px;
  --space-2: 9.2px;
  --space-3: 13.8px;
  --space-4: 18.4px;
  --space-6: 27.6px;
  --space-8: 36.8px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 7px;
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
}

/* — base — */
* {
  box-sizing: border-box;
}
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
body {
  margin: 0;
  background-color: var(--color-bg);
  background-image: var(--persian-pattern);
  background-size: 96px 96px;
  background-position: 0 0;
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.75;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 0;
}
p {
  margin: 0;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--color-accent-700);
  text-decoration: none;
}
::selection {
  background: color-mix(in srgb, var(--color-accent) 22%, transparent);
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.plate {
  filter: sepia(0.22) saturate(0.82) contrast(1.05);
  background: var(--color-surface);
  padding: 6px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
}
.plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hairline {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--color-divider);
}

/* — nav — */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  backdrop-filter: blur(6px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  text-decoration: none;
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  overflow: hidden;
  flex: 0 0 auto;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: 15.5px;
}
.site-nav a {
  text-decoration: none;
  color: var(--color-text);
  letter-spacing: 0.04em;
}
.site-nav a:hover {
  color: var(--color-accent-700);
  text-decoration: none;
}
.language-toggle {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.language-toggle:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  border-color: var(--color-accent);
}

/* — header strip + strolling cat — */
.header-photo-strip {
  position: relative;
  border-bottom: 1px solid var(--color-divider);
}
.header-photo-strip .strip-plate {
  height: 150px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
}
.stroll-wrap {
  position: absolute;
  top: -30px;
  left: -70px;
  width: 52px;
  animation: stroll 36s linear infinite alternate;
}
.stroll-wrap img {
  animation: catBob 0.9s ease-in-out infinite;
}
.stroll-wrap.flip img {
  transform: scaleX(-1);
  animation: none;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.section {
  padding: var(--space-8) 0;
  scroll-margin-top: 78px;
}

/* — section headings — */
.section-heading {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  position: relative;
}
.section-heading h2 {
  color: var(--color-heading);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.section-heading .hairline-below {
  margin: var(--space-3) 0 var(--space-6);
}
.heading-cat {
  width: 44px;
  margin-bottom: 2px;
}

/* — hero — */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: var(--space-8);
  align-items: start;
  padding: calc(var(--space-8) * 1.6) 0 var(--space-8);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.hero h1 {
  font-size: 60px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.01em;
}
.name-reading {
  font-family: var(--font-heading);
  font-size: 20px;
  font-style: normal;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
}
.hero-rule {
  height: 1px;
  width: 88px;
  background: var(--color-accent);
  margin: var(--space-1) 0;
}
.affiliation {
  font-size: 17px;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}
.summary {
  max-width: 46em;
  text-align: justify;
  line-height: 1.9;
  font-size: 18.5px;
}
.work-interests {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--color-divider);
  border-radius: 12px;
  background: var(--color-surface);
  scroll-margin-top: 78px;
}
.work-interests h2 {
  color: var(--color-heading);
  font-size: 23px;
  line-height: 1.45;
}
.work-interests-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-left: 1.4em;
  list-style: disc;
  font-size: 18px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.2;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.button-primary {
  border-color: var(--color-accent);
  color: var(--color-text);
}
.button-primary:hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}
.button-secondary {
  border-color: var(--color-divider);
}
.button-secondary:hover {
  background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.update-note {
  position: relative;
  margin-top: var(--space-4);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
  max-width: 520px;
}
.note-cat-wrap {
  position: absolute;
  top: -23px;
  right: 22px;
  width: 44px;
  overflow: hidden;
}
.note-cat-wrap img {
  animation: peek 7s ease-in-out infinite;
}
.update-note-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-700);
}
.update-note-date {
  font-size: 14.5px;
  font-feature-settings: "tnum";
}
.update-note-text {
  font-size: 16px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.hero-figure {
  margin: 0;
  animation: sway 9s ease-in-out infinite;
  transform-origin: top center;
}
.hero-figure .plate img {
  aspect-ratio: 4 / 5;
}
.hero-figure figcaption {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
  font-feature-settings: "tnum";
}

/* — research — */
.lede {
  max-width: 52em;
  text-align: justify;
  line-height: 1.95;
  font-size: 19px;
  margin-bottom: var(--space-6);
}
.keyword-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  background: transparent;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}
.card-kicker {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-feature-settings: "tnum";
}
.card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
}

/* — career — */
.career-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.career-group {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-6);
}
.career-group-title {
  color: var(--color-heading);
  font-size: 27px;
  font-weight: 600;
}
.timeline {
  border-left: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
}
.timeline-item {
  position: relative;
  padding: 0 0 var(--space-4) var(--space-6);
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -3.5px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--color-accent);
  background: var(--color-bg);
}
.timeline-item.current::before {
  background: var(--color-accent);
}
.timeline-year {
  font-size: 13.5px;
  letter-spacing: 0.06em;
  color: var(--color-accent-700);
  font-feature-settings: "tnum";
}
.timeline-title {
  margin-top: 2px;
  font-size: 18px;
  text-align: justify;
  line-height: 1.8;
}
.timeline-detail {
  margin-top: 4px;
  font-size: 16.5px;
  text-align: justify;
  line-height: 1.8;
  color: color-mix(in srgb, var(--color-text) 72%, transparent);
}

/* — memberships — */
.membership-card {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}
.membership-card:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.membership-card:hover .membership-name,
.membership-card:hover .membership-website {
  color: var(--color-accent-700);
}
.membership-logo {
  display: grid;
  place-items: center;
  width: 150px;
  min-height: 53px;
}
.membership-logo img {
  grid-area: 1 / 1;
  width: 150px;
  height: 53px;
  object-fit: contain;
}
.membership-logo-reverse {
  display: none;
}
[data-theme="dark"] .membership-logo-positive {
  display: none;
}
[data-theme="dark"] .membership-logo-reverse {
  display: block;
}
.membership-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.membership-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.membership-role {
  font-size: 14.5px;
  color: color-mix(in srgb, var(--color-text) 65%, transparent);
}
.membership-website {
  font-size: 13.5px;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

/* — publications — */
.publication-group-title {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--color-heading);
  margin-bottom: var(--space-3);
}
.publication-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.publication-card {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-divider);
}
.publication-title {
  font-size: 21px;
  font-family: var(--font-heading);
  font-weight: 600;
}
.publication-meta {
  margin-top: 4px;
  font-size: 15.5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.publication-venue {
  margin-top: 2px;
  font-size: 15px;
  font-style: italic;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  font-feature-settings: "tnum";
}
.publication-link {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 6px;
  font-size: 14.5px;
}
.publication-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-heading);
}
.publication-link span {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.publication-link a:hover {
  color: var(--color-accent-700);
}
.publication-link-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: currentColor;
}

/* — projects — */
.project-card {
  align-items: center;
  text-align: center;
  padding: var(--space-8);
  gap: var(--space-3);
}
.projects-note {
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.projects-excuse {
  font-style: italic;
  font-size: 14.5px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.yarn-scene {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: var(--space-2);
}
.yarn-scene img {
  width: 56px;
  animation: pounce 5s ease-in-out infinite;
}
.yarn-ball {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  animation: yarnRoll 5s ease-in-out infinite;
}

/* — gallery — */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}
.gallery-card {
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}
.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
  color: var(--color-text);
}
.gallery-card:hover .gallery-title {
  color: var(--color-accent-700);
}
.gallery-card .plate {
  margin: var(--space-2);
  height: 170px;
  overflow: hidden;
}
.gallery-card-body {
  padding: var(--space-2) var(--space-3) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gallery-date {
  font-size: 12.5px;
  color: var(--color-accent-700);
  font-feature-settings: "tnum";
}
.gallery-title {
  font-size: 22px;
  font-weight: 600;
}
.gallery-text {
  font-size: 16px;
  line-height: 1.75;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.gallery-tags span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid var(--color-divider);
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.gallery-placeholder {
  border: 1px dashed var(--color-divider);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  padding: var(--space-6);
  text-align: center;
}
.gallery-placeholder img {
  width: 48px;
  margin: 0 auto var(--space-2);
}
.gallery-placeholder p {
  font-size: 13px;
  font-style: italic;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}

/* — contact — */
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
a.card {
  text-decoration: none;
  color: var(--color-text);
}
a.card:hover .card-title,
a.card:hover .link-value {
  color: var(--color-accent-700);
}
a.card .card-kicker {
  color: var(--color-text);
}
.contact-card {
  min-height: 92px;
  justify-content: center;
}
.contact-card .card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.contact-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: currentColor;
}
.contact-brand-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  object-fit: contain;
}
.contact-brand-icon.brand-jaist {
  border-radius: 50%;
}
.contact-icon.brand-github {
  color: #181717;
}
.contact-icon.brand-researchmap {
  color: #5f6368;
}
.contact-icon.brand-scholar {
  color: #4285f4;
}
.contact-icon.brand-orcid {
  color: #a6ce39;
}
.contact-icon.brand-linkedin {
  color: #0a66c2;
}
[data-theme="dark"] .contact-icon.brand-github {
  color: #f5f5f5;
}
[data-theme="dark"] .contact-icon.brand-researchmap {
  color: #bdc1c6;
}
.link-value {
  font-size: 17px;
  font-feature-settings: "tnum";
}
.link-value-action {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s ease;
}
.wax-seal {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-6);
}
.wax-seal img {
  width: 54px;
  opacity: 0.85;
}

/* — footer — */
.site-footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-8) var(--space-6) calc(var(--space-8) * 1.4);
  text-align: center;
  background: color-mix(in srgb, var(--color-surface) 72%, transparent);
}
.footer-links {
  margin-top: var(--space-4);
  font-size: 1rem;
  scroll-margin-top: 90px;
}
.footer-links a {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
}
.footer-cat-img {
  width: 56px;
  margin: 0 auto var(--space-3);
}
.colophon-line {
  font-family: var(--font-heading);
  font-style: normal;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
}
.colophon-note {
  margin-top: 6px;
  font-size: 13.5px;
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.colophon-footnote {
  margin-top: 4px;
  font-size: 12.5px;
  font-style: italic;
  color: color-mix(in srgb, var(--color-text) 42%, transparent);
}
.copyright {
  margin-top: var(--space-4);
  font-size: 13px;
  font-feature-settings: "tnum";
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}

/* — cats & motion — */
.cat-breathe {
  animation: breathe 3.4s ease-in-out infinite;
  transform-origin: bottom center;
}
.cat-breathe-slow {
  animation: breathe 4.2s ease-in-out infinite;
  transform-origin: bottom center;
}
.cat-tail {
  animation: tailTilt 4s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes stroll {
  0% {
    left: -70px;
  }
  100% {
    left: calc(100% + 70px);
  }
}
@keyframes catBob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-1.5deg);
  }
  75% {
    transform: translateY(-1px) rotate(1.5deg);
  }
}
@keyframes breathe {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.045);
  }
}
@keyframes peek {
  0%,
  62%,
  100% {
    transform: translateY(14px);
  }
  72%,
  90% {
    transform: translateY(0);
  }
}
@keyframes pounce {
  0%,
  55%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  62% {
    transform: translateX(-6px) rotate(-4deg);
  }
  70% {
    transform: translateX(14px) rotate(3deg) translateY(-6px);
  }
  78% {
    transform: translateX(10px) rotate(0deg);
  }
}
@keyframes yarnRoll {
  0%,
  55%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  70% {
    transform: translateX(38px) rotate(200deg);
  }
  84% {
    transform: translateX(26px) rotate(150deg);
  }
}
@keyframes tailTilt {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-2.5deg);
  }
}
@keyframes sway {
  0%,
  100% {
    transform: rotate(-1.2deg);
  }
  50% {
    transform: rotate(0.4deg);
  }
}

/* — scroll reveal (driven by classical.js) — */
.reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.is-pending {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-pending {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .stroll-wrap,
  .stroll-wrap img,
  .cat-breathe,
  .cat-breathe-slow,
  .cat-tail,
  .hero-figure,
  .note-cat-wrap img,
  .yarn-scene img,
  .yarn-ball {
    animation: none !important;
  }
}

/* — responsive — */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding-top: var(--space-8);
  }
  .hero-figure {
    max-width: 320px;
  }
  .hero h1 {
    font-size: 50px;
  }
  .career-group {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .keyword-grid,
  .gallery-grid,
  .link-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  body {
    background-attachment: scroll;
  }
  main {
    padding: 0 var(--space-4);
  }
  .keyword-grid,
  .gallery-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 41px;
  }
  .section-heading h2 {
    font-size: 34px;
  }
  .membership-card {
    grid-template-columns: 120px 1fr;
  }
  .membership-logo,
  .membership-logo img {
    width: 112px;
    height: auto;
  }
  .membership-name {
    font-size: 19px;
  }
  .membership-website {
    grid-column: 2;
  }
}

/* — theme toggle + hamburger — */
.theme-toggle {
  font-size: 17px;
  line-height: 1;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  width: 36px;
  height: 34px;
  cursor: pointer;
}
.theme-toggle:hover {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 34px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 1px;
  background: var(--color-text);
}
.nav-toggle:hover {
  border-color: var(--color-accent);
}
@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }
  .site-header .site-nav {
    display: none;
  }
  .site-header.nav-open .site-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: var(--space-4);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-divider);
    box-shadow: var(--shadow-md);
  }
  .site-header {
    position: sticky;
  }
}

/* — lightbox — */
.photo-detail-figure img,
.analysis-figure img {
  cursor: zoom-in;
}
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, #141210 84%, transparent);
  cursor: zoom-out;
}
.lightbox-backdrop figure {
  margin: 0;
  max-width: min(1200px, 94vw);
}
.lightbox-backdrop img {
  max-width: 100%;
  max-height: 84vh;
  display: block;
  margin: 0 auto;
  background: var(--color-surface);
  padding: 8px;
  box-shadow: var(--shadow-lg);
}
.lightbox-caption {
  color: #f3f2f2;
  font-size: 14.5px;
  margin-top: 12px;
  text-align: center;
  font-style: italic;
}

/* — Persian garden at night: lapis ground, celadon headings, aged gold — */
[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #162c43;
  --color-surface: #203b52;
  --color-text: #f1e8d6;
  --color-heading: #8fc8bb;
  --color-accent: #d6a54a;
  --color-divider: #50687a;
  --persian-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%238fc8bb' stroke-opacity='.045' stroke-width='1'%3E%3Cpath d='M48 0L96 48L48 96L0 48Z'/%3E%3Cpath d='M48 16L53.4 35.1L70.6 25.4L60.9 42.6L80 48L60.9 53.4L70.6 70.6L53.4 60.9L48 80L42.6 60.9L25.4 70.6L35.1 53.4L16 48L35.1 42.6L25.4 25.4L42.6 35.1Z'/%3E%3C/g%3E%3Ccircle cx='48' cy='48' r='1.2' fill='%23d6a54a' fill-opacity='.09'/%3E%3C/svg%3E");
  --color-accent-100: #463c29;
  --color-accent-600: #e1b863;
  --color-accent-700: #ebc774;
  --color-accent-800: #f6dfa9;
  --shadow-sm: 0 1px 2px color-mix(in srgb, #081725 42%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #081725 50%, transparent);
}
[data-theme="dark"] .plate {
  filter: sepia(0.08) saturate(0.92) contrast(1.03) brightness(0.95);
}
[data-theme="dark"] .site-header {
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
}

/* — forest research observatory (home only) — */
.home-page .brand-mark {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--color-heading) 28%, transparent),
    var(--shadow-sm);
}
.home-page .header-photo-strip {
  overflow: hidden;
  isolation: isolate;
}
.home-page .header-photo-strip::before,
.home-page .header-photo-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.home-page .header-photo-strip::before {
  z-index: 1;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, #174d63 36%, transparent),
    transparent 46%,
    color-mix(in srgb, #2f7f7a 24%, transparent)
  );
  mix-blend-mode: multiply;
}
.home-page .header-photo-strip::after {
  z-index: 1;
  background:
    radial-gradient(
      ellipse at 2% -20%,
      color-mix(in srgb, #183e55 56%, transparent) 0 22%,
      transparent 23%
    ),
    radial-gradient(
      ellipse at 88% -28%,
      color-mix(in srgb, #2f7f7a 38%, transparent) 0 26%,
      transparent 27%
    );
}
.forest-perch {
  position: absolute;
  z-index: 3;
  right: clamp(12px, 5vw, 72px);
  bottom: 2px;
  width: clamp(190px, 25vw, 286px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 3px 4px color-mix(in srgb, #15251b 32%, transparent));
}
.perch-branch,
.perch-twig {
  fill: none;
  stroke: #3e3225;
  stroke-linecap: round;
}
.perch-branch {
  stroke-width: 7;
}
.perch-twig {
  stroke-width: 4;
}
.perch-bud {
  fill: var(--color-accent);
}
.forest-bird-arrival {
  transform-box: fill-box;
  transform-origin: center;
  animation: forestBirdArrival 2.35s cubic-bezier(0.18, 0.72, 0.24, 1) 0.2s both;
}
.bird-body,
.bird-head {
  fill: #667a4d;
  stroke: #263126;
  stroke-width: 2.2;
}
.bird-belly {
  fill: #eee8d9;
  opacity: 0.95;
}
.bird-tail {
  fill: #40563c;
  stroke: #263126;
  stroke-width: 2;
}
.bird-wing {
  fill: #4c5a3c;
  stroke: #263126;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: 88% 45%;
  animation: birdWingBeat 0.18s ease-in-out 0.25s 11 alternate;
}
.bird-wing-line {
  fill: none;
  stroke: #91a27b;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.bird-beak {
  fill: var(--color-accent);
  stroke: #332d25;
  stroke-width: 1.4;
}
.bird-eye-ring {
  fill: #f7f1e4;
}
.bird-eye {
  fill: #201f1d;
}
.bird-leg {
  fill: none;
  stroke: #5a4430;
  stroke-width: 2;
  stroke-linecap: round;
}

.home-page .section-heading h2 {
  text-wrap: balance;
}
.home-page .hairline {
  background: color-mix(in srgb, var(--color-heading) 38%, var(--color-divider));
}

[data-theme="dark"] .home-page .header-photo-strip::before {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, #071f33 44%, transparent),
    transparent 45%,
    color-mix(in srgb, #0c344a 34%, transparent)
  );
}

@keyframes forestBirdArrival {
  0% {
    opacity: 0;
    transform: translate(180px, -62px) rotate(-10deg) scale(0.88);
  }
  28% {
    opacity: 1;
  }
  66% {
    transform: translate(22px, -12px) rotate(4deg) scale(1);
  }
  82% {
    transform: translate(-4px, 3px) rotate(-2deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0) scale(1);
  }
}
@keyframes birdWingBeat {
  from {
    transform: rotate(-17deg) scaleY(0.72);
  }
  to {
    transform: rotate(15deg) scaleY(1.12);
  }
}

@media (max-width: 900px) {
  .forest-perch {
    right: 10px;
    width: 220px;
  }
}
@media (max-width: 560px) {
  .forest-perch {
    right: -28px;
    width: 190px;
    opacity: 0.92;
  }
  .forest-bird-arrival,
  .bird-wing {
    animation: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .forest-bird-arrival,
  .bird-wing {
    animation: none !important;
  }
}

/* Illustrated entrance: two manually selected scenes. */
.scene-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: min(820px, calc(100svh - 76px));
  min-height: 460px;
  overflow: hidden;
  background: #092439;
  color: #fff3d9;
  scroll-margin-top: 76px;
}
.scene-images,
.scene-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scene-image {
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.scene-image.is-active {
  opacity: 1;
}
.scene-heading {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 78%);
  text-align: center;
  text-shadow:
    0 2px 16px #06182c,
    0 1px 4px #06182c;
}
.scene-eyebrow {
  font-size: 11px;
  letter-spacing: 0.28em;
  margin-bottom: 12px;
}
.scene-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4.2vw, 65px);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: 0.015em;
}
.scene-controls {
  position: absolute;
  bottom: 29px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  border: 1px solid #d9bc7d99;
  border-radius: 32px;
  background: #071e32e8;
  color: #cbb68c;
}
.scene-controls[hidden] {
  display: none;
}
.scene-controls button {
  min-width: 65px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: #d5cfbd;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}
.scene-controls button[aria-pressed="true"] {
  background: #e9d6a9;
  color: #102a3d;
}
.scene-controls button:hover {
  box-shadow: inset 0 0 0 1px #d9bc7d;
}
.scene-controls button:focus-visible,
.scene-scroll:focus-visible {
  outline: 2px solid #fff3d9;
  outline-offset: 4px;
}
.scene-scroll {
  position: absolute;
  right: 30px;
  bottom: 35px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #fff3d9;
  text-shadow: 0 1px 6px #06182c;
}
.scene-scroll:hover {
  color: #fff;
}
.scene-scroll span {
  display: inline-block;
  margin-left: 10px;
}
#about {
  scroll-margin-top: 90px;
}
@media (max-width: 640px) {
  .scene-hero {
    height: 72svh;
    min-height: 440px;
    max-height: 700px;
  }
  .scene-heading {
    top: 13%;
    width: 88%;
  }
  .scene-eyebrow {
    font-size: 9px;
    letter-spacing: 0.22em;
  }
  .scene-title {
    font-size: 37px;
  }
  .scene-controls {
    bottom: 28px;
  }
  .scene-scroll {
    right: 12px;
    bottom: 9px;
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .scene-image,
  .scene-controls button {
    transition: none;
  }
}

/* Quiet dot navigation for the automatic scene cycle. */
.scene-controls {
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.scene-controls button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
}
.scene-controls button::after {
  content: "";
  width: 9px;
  height: 9px;
  border: 1px solid #fff3d9;
  border-radius: 50%;
  background: #09243980;
  box-shadow: 0 1px 5px #092439;
  transition: background 0.3s;
}
.scene-controls button[aria-pressed="true"] {
  background: transparent;
}
.scene-controls button[aria-pressed="true"]::after {
  background: #fff3d9;
}
.scene-controls button:hover {
  box-shadow: none;
}
.scene-controls button:hover::after {
  background: #e9d6a9;
}

/* Keep the dawn sky bright while making its title readable. */
.scene-heading {
  transition:
    color 1.2s ease,
    text-shadow 1.2s ease;
}
.scene-hero[data-heading-tone="dark"] .scene-heading {
  color: #302b33;
  text-shadow:
    0 1px 10px #fff0d9,
    0 1px 3px #fff0d9;
}
@media (prefers-reduced-motion: reduce) {
  .scene-heading {
    transition: none;
  }
}

@media (max-width: 380px) {
  .scene-controls button {
    min-width: 36px;
  }
}

.scene-credit {
  position: absolute;
  right: 30px;
  bottom: 8px;
  padding: 2px 6px;
  color: #fff3d9;
  background: #071e32b8;
  border-radius: 2px;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
@media (max-width: 640px) {
  .scene-credit {
    right: 12px;
    bottom: 8px;
    font-size: 9px;
  }
  .scene-scroll {
    left: 12px;
    right: auto;
    bottom: 10px;
  }
}

/* Twenty-six scenes: two rows on desktop, three on most small screens. */
.scene-controls {
  display: grid;
  grid-template-columns: repeat(13, 36px);
}
.scene-controls button {
  min-width: 36px;
  min-height: 36px;
}
@media (max-width: 800px) {
  .scene-controls {
    grid-template-columns: repeat(9, 36px);
  }
}
@media (max-width: 380px) {
  .scene-controls {
    grid-template-columns: repeat(7, 36px);
  }
}

/* Profile without a portrait column. */
.hero.hero-text-only {
  grid-template-columns: minmax(0, 1fr);
}
.hero-text-only .hero-copy {
  max-width: 800px;
}

/* Match the former profile portrait's column and display size. */
.hero.hero-with-avatar {
  grid-template-columns: 1.25fr 0.75fr;
}
.profile-pixel {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: contain;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  background: #fffdf2;
}
@media (max-width: 900px) {
  .hero.hero-with-avatar {
    grid-template-columns: 1fr;
  }
  .profile-pixel {
    max-width: 320px;
  }
}

/* A woven border around the garden's navigation. */
.site-header {
  padding-top: 20px;
  padding-bottom: 22px;
}
.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background: url("assets/header-lace.svg") repeat-x center / 72px 12px;
  pointer-events: none;
  opacity: 0.8;
}
.site-header::before {
  top: 0;
}
.site-header::after {
  bottom: 0;
}
.site-header .garden-nav {
  display: flex;
  gap: clamp(18px, 3vw, 38px);
  align-items: center;
}
.garden-nav :focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 5px;
}
.garden-intro {
  padding-block: 70px;
}
.garden-intro h1 {
  font-size: clamp(36px, 5vw, 58px);
  margin-bottom: 24px;
}
.garden-kicker {
  letter-spacing: 0.22em;
  font-size: 11px;
  margin-bottom: 14px;
}
.garden-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.garden-entry {
  padding: 28px 24px;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  border-radius: 6px;
  color: var(--color-text);
}
.garden-entry:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}
.garden-entry > span {
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0.7;
}
.garden-entry h2 {
  font-size: 27px;
  margin: 14px 0;
}
.garden-entry p {
  font-size: 15px;
  line-height: 1.8;
}
.garden-author {
  margin-top: 28px;
  padding-left: 16px;
  border-left: 2px solid var(--color-accent);
}
.garden-author-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.garden-author-line a {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 600;
  color: var(--color-heading);
}
.garden-author-line span {
  font-size: 14.5px;
  color: color-mix(in srgb, var(--color-text) 75%, transparent);
}
.garden-research {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.8;
}
.garden-news {
  padding-top: 0;
}
.garden-news h2 {
  font-size: 27px;
  margin-bottom: 18px;
}
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-divider);
}
.news-list li {
  display: grid;
  grid-template-columns: 8.5em 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: 15.5px;
  line-height: 1.7;
}
.news-list time {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--color-accent-700);
  font-feature-settings: "tnum";
}
.news-list a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-heading) 40%, transparent);
  text-underline-offset: 5px;
}
.news-list a:hover {
  color: var(--color-heading);
  text-decoration: underline;
}
.category-index {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}
.category-index a {
  padding: 10px 18px;
  border: 1px solid var(--color-divider);
  border-radius: 24px;
  color: var(--color-text);
}
.blog-category {
  padding: 36px 0;
  border-top: 1px solid var(--color-divider);
  scroll-margin-top: 130px;
}
.blog-category h2 {
  font-size: 30px;
}
.category-description {
  margin: 10px 0 24px;
  line-height: 1.8;
}
.category-empty {
  padding: 24px;
  border: 1px dashed var(--color-divider);
  color: var(--color-text);
  opacity: 0.7;
}
@media (max-width: 700px) {
  .site-header {
    column-gap: 12px;
    row-gap: 14px;
  }
  .site-header .garden-nav {
    order: 5;
    width: 100%;
    justify-content: center;
    gap: 38px;
    font-size: 15px;
  }
  .garden-entry-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .garden-intro {
    padding-block: 40px;
  }
  .news-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .scene-hero,
  #about,
  #explore {
    scroll-margin-top: 135px;
  }
}

/* Four peer navigation links remain readable on narrow screens. */
.garden-nav a[aria-current="page"] {
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 6px;
}
@media (max-width: 700px) {
  .site-header .garden-nav {
    gap: clamp(16px, 5vw, 28px);
  }
}
