/* 1. Variables and common styles
   ========================================================= */
:root {
  --text: #202020;
  --muted: #6a6a6a;
  --line: #969696;
  --paper: #ffffff;
  --soft: #fafafa;
  --footer: #dbe7ef;
  --accent: #f79a38;
  --max: 1080px;
  --header-h: 62px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--paper);
  font-family: "Roboto", "Noto Sans JP", sans-serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

main {
  width: 100%;
  margin: 0;
  background: #fff;
  box-shadow: none;
  overflow: visible;
}

.container {
  width: min(calc(100% - 80px), var(--max));
  margin-inline: auto;
}

.section {
  padding: 58px 0;
}


/* 2. Header and navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 34px;
  width: min(calc(100% - 48px), 1440px);
  height: 100%;
  margin-inline: auto;
}

.site-name {
  margin-right: auto;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  opacity: 0;
  pointer-events: none;
}

.global-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 2.4vw, 40px);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .02em;
}

.global-nav a {
  position: relative;
  padding: 22px 0 19px;
}

.global-nav a::after {
  position: absolute;
  bottom: 12px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transition: width .25s ease;
}

.global-nav a:hover::after,
.global-nav a:focus-visible::after {
  width: 100%;
}

/* Language switch */
.language-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 7px 11px !important;
  border: 1px solid #222;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .06em;
  transition:
    background .2s ease,
    color .2s ease,
    opacity .2s ease;
}

.global-nav .language-switch::after {
  display: none;
}

.language-switch:hover,
.language-switch:focus-visible {
  color: #fff;
  background: #222;
}

/* Mobile menu controls: hidden on desktop */
.menu-toggle,
.menu-button {
  display: none;
}


/* 3. Hero
   ========================================================= */
.hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: clamp(360px, 48vw, 620px);
  overflow: hidden;
}

.hero > img {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  animation: hero-fade-in .9s ease-out both;
}

.hero .hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, .70) 0%,
    rgba(255, 255, 255, .16) 36%,
    rgba(255, 255, 255, 0) 62%
  );
  pointer-events: none;
}

.hero .hero-institute {
  position: absolute;
  top: clamp(24px, 3vw, 42px);
  bottom: clamp(26px, 3.4vw, 54px);
  left: clamp(24px, 4vw, 72px);
  z-index: 3;
  color: #40545a;
  text-shadow: 0 1px 12px rgba(255, 255, 255, .96);
  animation: hero-copy-in 1s .2s cubic-bezier(.22, .8, .3, 1) both;
}

.hero .hero-institute-en {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(25px, 2.05vw, 35px);
  font-weight: 400;
  line-height: 1.13;
  letter-spacing: .075em;
}

.hero .hero-institute-jp {
  margin-top: 9px;
  font-family: "Noto Sans JP", sans-serif;
  font-size: clamp(21px, 1.6vw, 27px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: .11em;
  animation: hero-jp-in .9s 1.35s ease-out both;
}

/* Hero entrance animations */
@keyframes hero-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hero-copy-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-jp-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* 4. Overview
   ========================================================= */
.overview {
  position: relative;
  z-index: 2;
  background: #fff;
}

.overview-inner {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: center;
  gap: clamp(42px, 5vw, 72px);
  max-width: 1080px;
  padding-top: 10px;
  padding-bottom: 18px;
}

.overview-mark img {
  width: 220px;
  margin-inline: auto;
}

.overview-copy {
  max-width: 900px;
}

.overview-copy p {
  margin: 0;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 2;
  text-align: justify;
}


/* 5. News
   ========================================================= */
.news {
  padding-top: 18px;
  padding-bottom: 52px;
  background: #fff;
}

#news {
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.news-inner {
  position: relative;
  max-width: 1080px;
  padding-top: 18px;
}

/* Section title */
.section-image-title {
  width: auto;
  margin: 0 auto 30px;
  color: #40545a;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: .03em;
  text-align: center;
}

/* News list */
.news-list {
  border-top: 1px solid var(--line);
}

.news-item {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}

.news-item time {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .06em;
}

.news-body {
  min-width: 0;
  font-size: 15px;
  line-height: 1.65;
}

.news-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity .2s ease;
}

.news-body a:hover {
  opacity: .55;
}

.news-arrow {
  justify-self: end;
  font-size: 22px;
  line-height: 1;
}

/* News toggle: CSS-based expand/collapse */
.news-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.news-list .news-item--extra {
  display: none;
}

.news-toggle:checked + .news-list .news-item--extra {
  display: grid;
}

.view-all,
.close-news {
  width: 170px;
  margin: 14px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition:
    transform .25s ease,
    opacity .2s ease;
}

.view-all {
  display: block;
}

.close-news {
  display: none;
  width: 145px;
  margin-top: 24px;
}

.view-all:hover,
.close-news:hover {
  transform: translateY(-3px);
  opacity: .8;
}

.news-toggle:focus-visible ~ .view-all,
.news-toggle:focus-visible ~ .close-news {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.view-all img,
.close-news img {
  width: 100%;
  height: auto;
}

.news-toggle:checked ~ .view-all {
  display: none;
}

.news-toggle:checked ~ .close-news {
  display: block;
}

/* News archive link */
.past-news-link {
  display: block;
  width: fit-content;
  margin: 24px auto 0;
  color: #40545a;
  font-family: "Fraunces", Georgia, serif;
  font-size: 17px;
  letter-spacing: .06em;
  text-decoration: none;
}

.past-news-link:hover {
  opacity: .7;
}


/* 6. Access and Contact
   ========================================================= */
.info {
  padding-top: 54px;
  padding-bottom: 54px;
  background: #fafafa;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  column-gap: clamp(48px, 6vw, 82px);
  row-gap: 36px;
  max-width: 1040px;
  margin-inline: auto;
}

.info-card {
  min-width: 0;
}

/* Access */
.info-image-title {
  width: 230px;
  margin: 0 0 32px;
}

.address {
  margin-bottom: 20px;
  font-size: 15px;
  font-style: normal;
  line-height: 1.6;
}

/* Contact */
#contact {
  display: flex;
  flex-direction: column;
}

.contact-copy {
  margin: 0 0 24px;
  font-size: 16px;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 20px;
  border: 1px solid #222;
  font-weight: 600;
  letter-spacing: .04em;
  transition:
    background .2s ease,
    color .2s ease;
}

.contact-button:hover {
  color: #fff;
  background: #222;
}

/* Map */
.map-wrap {
  position: relative;
  grid-column: 1 / -1;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 6;
  background: #eef1e8;
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(.7) contrast(.9) brightness(1.06);
}


/* 7. Partner logos
   ========================================================= */
.partners {
  position: relative;
  padding-top: 42px;
  padding-bottom: 42px;
  background: linear-gradient(
    180deg,
    #fff 0%,
    #fff 38%,
    #f4f8fa 72%,
    #e8f0f5 100%
  );
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 24px 46px;
  max-width: 1040px;
  margin-inline: auto;
}

.partner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 86px;
  padding: 8px 14px;
  overflow: hidden;
  transition: opacity .2s ease;
}

.partner-link:hover {
  opacity: .65;
}

.partner-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Decorative character */
.partners-character {
  position: absolute;
  right: clamp(24px, 4vw, 64px);
  bottom: 18px;
  width: clamp(120px, 11vw, 175px);
  pointer-events: none;
}

.partners-character img {
  width: 100%;
  height: auto;
}


/* 8. Footer
   ========================================================= */
.site-footer {
  width: 100%;
  margin: 0;
  padding: 11px 0;
  background: var(--footer);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}


/* 9. Tablet
   ========================================================= */
@media (max-width: 900px) {
  :root {
    --header-h: 58px;
  }

  .container {
    width: min(calc(100% - 48px), var(--max));
  }

  .section {
    padding: 64px 0;
  }

  /* Header */
  .site-name {
    max-width: 230px;
    overflow: hidden;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 1;
    pointer-events: auto;
  }

  .header-inner {
    width: calc(100% - 36px);
  }

  .menu-toggle {
    display: none;
  }

  .menu-button {
    position: relative;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    margin-left: auto;
    padding: 9px;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .menu-toggle:focus-visible + .menu-button {
    outline: 2px solid #222;
    outline-offset: 2px;
  }

  .menu-button span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: #111;
    transition:
      transform .25s ease,
      opacity .25s ease;
  }

  .menu-toggle:checked + .menu-button span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }

  .menu-toggle:checked + .menu-button span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle:checked + .menu-button span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }

  .global-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    left: 0;
    z-index: 9999;
    display: none;
    gap: 0;
    max-height: calc(100dvh - var(--header-h));
    padding: 18px 24px 28px;
    overflow-y: auto;
    background: rgba(255, 255, 255, .82);
    border-top: 1px solid #eee;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    -webkit-overflow-scrolling: touch;
  }

  .menu-toggle:checked ~ .global-nav {
    display: grid;
  }

  .global-nav a {
    padding: 14px 4px;
    border-bottom: 1px solid #eee;
  }

  .global-nav a::after {
    display: none;
  }

  .language-switch {
    width: fit-content;
    min-width: 70px;
    margin-top: 14px;
    padding: 10px 16px !important;
    border: 1px solid #222 !important;
    text-align: center;
  }

  /* Overview */
  .overview-inner {
    grid-template-columns: 180px 1fr;
    gap: 42px;
  }

  .overview-mark img {
    width: 175px;
  }

  /* Information */
  .info-grid {
    gap: 52px;
  }

  /* Partner logos */
  .partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* 10. Mobile
   ========================================================= */
@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 36px), var(--max));
  }

  .section {
    padding: 52px 0;
  }

  /* Header */
  .header-inner {
    width: calc(100% - 24px);
  }

  .site-name {
    max-width: 210px;
    font-size: 10px;
  }

  /* Hero */
  .hero {
    height: clamp(300px, 82vw, 430px);
  }

  .hero .hero-institute {
    top: 18px;
    right: 16px;
    bottom: 14px;
    left: 16px;
  }

  .hero .hero-institute-en {
    font-size: 17px;
    line-height: 1.18;
    letter-spacing: .055em;
  }

  .hero .hero-institute-jp {
    margin-top: 5px;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: .075em;
  }

  /* Overview */
  .overview {
    padding-top: 48px;
  }

  .overview-inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .overview .overview-inner {
    padding-top: 10px;
    padding-bottom: 16px;
  }

  .overview-mark img {
    width: 145px;
  }

  .overview-copy p {
    font-size: 16px;
    line-height: 1.9;
    text-align: left;
  }

  /* News */
  .news {
    padding-top: 16px;
  }

  .news .news-inner {
    padding-top: 16px;
  }

  .section-image-title {
    width: auto;
    margin-bottom: 30px;
    font-size: 32px;
  }

  .news-item {
    grid-template-columns: 1fr 25px;
    gap: 8px 16px;
    min-height: 84px;
    padding: 14px 2px;
  }

  .news-item time {
    grid-column: 1;
    font-size: 11px;
  }

  .news-body {
    grid-column: 1;
    font-size: 14px;
    line-height: 1.55;
  }

  .news-item a {
    font-size: 14px;
    line-height: 1.55;
  }

  .news-arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .view-all {
    width: 135px;
    margin-top: 12px;
  }

  .close-news {
    width: 120px;
    margin-top: 18px;
  }

  /* Access and Contact */
  .info-grid {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .map-wrap {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 3;
    margin-top: 0;
  }

  .info-image-title {
    width: 190px;
    margin-bottom: 20px;
  }

  .address,
  .contact-copy {
    font-size: 14px;
  }

  .contact-button {
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 18px;
  }

  /* Partner logos */
  .partner-grid {
    gap: 16px 20px;
  }

  .partner-link {
    height: 68px;
    padding: 5px 7px;
  }

  .partners {
    padding-bottom: 100px;
  }

  .partners-character {
    right: 18px;
    bottom: 14px;
    width: 105px;
  }

  /* Footer */
  .site-footer p {
    font-size: 10px;
  }
}


/* 11. Reduced motion accessibility
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .hero > img,
  .hero .hero-institute,
  .hero .hero-institute-jp {
    animation: none !important;
    transform: none !important;
  }
}


/* 12. Past news page
   ========================================================= */
.past-news-page {
  background: #f7f5f1;
  color: #2f3436;
}

.past-news-hero {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  height: 300px;
  padding: 54px 24px 50px;
  text-align: left;
  color: #40545a;
  background:
    radial-gradient(circle at 18% 30%, rgba(220, 188, 158, .42), transparent 38%),
    radial-gradient(circle at 84% 18%, rgba(168, 194, 201, .50), transparent 42%),
    linear-gradient(135deg, #edf3f4 0%, #f3eee8 55%, #e7eff1 100%);
}

.past-news-kicker {
  margin: 0 0 8px;
  color: #8b7264;
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  letter-spacing: .13em;
}

.past-news-hero h1 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 400;
  letter-spacing: .035em;
}

.past-news-wrap {
  max-width: 960px;
  padding-top: 46px;
  padding-bottom: 70px;
}

/* "← LATEST NEWS" link: reuses .past-news-link, with more top space */
.past-news-wrap .past-news-link {
  margin-top: 36px;
}

@media (max-width: 640px) {
  .past-news-hero {
    padding: 42px 18px 38px;
  }

  .past-news-kicker {
    font-size: 20px;
  }

  .past-news-hero h1 {
    font-size: 44px;
  }
}
