/* =========================
   Hasegawa Laboratory
   style.css
========================= */

:root {
  --bg: #ffffff;
  --surface: #f5f6f7;
  --surface-dark: #111317;
  --text: #17191d;
  --muted: #6e747c;
  --line: #dfe3e8;
  --accent: #1e586d;
  --accent-dark: #143f4e;
  --max-width: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans JP",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    sans-serif;
  line-height: 1.75;
}

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

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

button {
  font: inherit;
}


/* =========================
   HEADER
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(223, 227, 232, 0.9);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(92%, var(--max-width));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-title {
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.global-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.global-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.global-nav a:hover,
.global-nav a:focus-visible {
  color: var(--text);
}

/* Hamburger button: hidden on desktop */
.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  background: var(--text);
}


/* =========================
   HERO
========================= */

.hero {
  position: relative;
  height: min(66vh, 680px);
  min-height: 480px;
  overflow: hidden;
  background: #1a1d21;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;

  opacity: 0;
  transform: scale(1.03);
  transition:
    opacity 1.4s ease,
    transform 7s ease;
}

/* 各写真の表示位置 */
.slide01 {
  object-position: 50% 50%;
}

.slide02 {
  object-position: 50% 50%;
}

.slide03 {
  object-position: 50% 30%;
}

.slide04 {
  object-position: 50% 25%;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(5, 10, 15, 0.68) 0%,
      rgba(5, 10, 15, 0.34) 42%,
      rgba(5, 10, 15, 0.08) 78%
    );
}

.hero-copy {
  position: absolute;
  z-index: 10;
  left: max(5vw, calc((100vw - var(--max-width)) / 2 + 4vw));
  bottom: 12%;
  width: min(760px, 78vw);
  color: #ffffff;
}

.hero-kicker {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.hero-copy > p:last-child {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.3rem);
}

.hero-dots {
  position: absolute;
  z-index: 20;
  right: 5%;
  bottom: 8%;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 34px;
  height: 3px;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.hero-dot.is-active {
  background: #ffffff;
}


/* =========================
   HOME LAYOUT
========================= */

.home-layout {
  width: min(92%, var(--max-width));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 64px;
  align-items: start;
}

.main-column {
  min-width: 0;
}

.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-child {
  border-bottom: 0;
}

.section-label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.section-heading {
  margin-bottom: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.text-link {
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent-dark);
}


/* =========================
   INTRO
========================= */

.intro-section {
  padding-top: 76px;
}

.intro-section h2 {
  max-width: 800px;
}

.intro-text {
  max-width: 820px;
  margin: 24px 0 0;
  color: #454a51;
  font-size: 1.03rem;
}

.primary-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  min-width: 190px;
  padding: 13px 20px;
  border: 1px solid var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 750;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #ffffff;
}

.button-primary:hover,
.button-primary:focus-visible {
  background: var(--accent-dark);
}

.button-secondary {
  background: transparent;
  color: var(--accent);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  background: #eef4f6;
}


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

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

.news-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 22px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.news-item time {
  color: var(--muted);
  font-size: 0.88rem;
}

.news-item a {
  font-weight: 600;
  transition: color 0.2s ease;
}

.news-item a:hover,
.news-item a:focus-visible {
  color: var(--accent);
}

.news-content {
  min-width: 0;
}

.news-publication-label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.news-publication-title {
  display: inline-block;
  font-weight: 600;
  line-height: 1.5;
}

.news-publication-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}


/* =========================
   PROFILE
========================= */

.profile-card {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 40px;
  align-items: center;
  background: var(--surface);
}

.profile-photo {
  min-height: 260px;
  height: 100%;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-content {
  padding: 32px 40px 32px 0;
}

.profile-content h3 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.2;
}

.profile-role {
  margin: 8px 0 20px;
  color: var(--muted);
}

.profile-links {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.profile-links a {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.profile-links a:hover,
.profile-links a:focus-visible {
  color: var(--accent-dark);
}


/* =========================
   DATA & SCRIPTS
========================= */

.resource-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.resource-card {
  min-height: 300px;
  padding: 34px;
  position: relative;
  background: var(--surface-dark);
  color: #ffffff;
  transition:
    transform 0.25s ease,
    background 0.25s ease;
}

.resource-card:hover,
.resource-card:focus-visible {
  transform: translateY(-3px);
  background: #1b2026;
}

.resource-number {
  color: #aeb6bf;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.resource-card h3 {
  margin: 44px 0 12px;
  font-size: 2rem;
}

.resource-card p {
  max-width: 780px;
  margin: 0 0 46px;
  color: #c6ccd2;
}

.resource-link {
  position: absolute;
  left: 34px;
  bottom: 30px;
  font-weight: 700;
}


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

.publication-list {
  border-top: 1px solid var(--line);
}

.publication-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.publication-year {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.publication-title {
  margin: 0 0 5px;
  font-size: 1rem;
  line-height: 1.55;
}

.publication-title a {
  transition: color 0.2s ease;
}

.publication-title a:hover,
.publication-title a:focus-visible {
  color: var(--accent);
}

.publication-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}


/* =========================
   LOADING / SYNC
========================= */

.loading-message,
.sync-message {
  margin: 0;
  padding: 18px 0;
  color: var(--muted);
  font-size: 0.9rem;
}


/* =========================
   X SIDEBAR
========================= */

.x-column {
  width: 330px;
  padding-top: 72px;
}

.x-panel {
  position: sticky;
  top: 100px;
}

.x-panel-heading {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.x-panel-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.x-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff;
  font-weight: 800;
}

.x-timeline-wrap {
  width: 330px;
  height: 900px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.x-timeline-wrap iframe {
  width: 100% !important;
}

.x-fallback-link {
  margin-top: 14px;
  display: inline-block;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}


/* =========================
   FOOTER
========================= */

.site-footer {
  margin-top: 48px;
  padding: 34px 0;
  background: #111317;
  color: #b8bec5;
}

.footer-inner {
  width: min(92%, var(--max-width));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 0.82rem;
}

.footer-inner p {
  margin: 0;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

  .header-inner {
    height: 72px;
    padding: 0;
    flex-wrap: nowrap;
    gap: 20px;
  }

  .site-title {
    flex-shrink: 0;
  }

  .global-nav {
    display: flex;
    margin-left: auto;
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 16px;
    white-space: nowrap;
  }

  .global-nav a {
    font-size: 0.85rem;
  }

  .home-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .x-column {
    padding: 0 0 72px;
  }

  .x-panel {
    position: static;
  }

  .profile-card {
    grid-template-columns: 190px 1fr;
  }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

  /* =========================
     HEADER / MOBILE NAV
  ========================= */

  .header-inner {
    height: 62px;
    position: relative;
    gap: 12px;
  }

  .site-title {
    flex-shrink: 0;
    font-size: 0.95rem;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 10px;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    cursor: pointer;
  }

  .menu-toggle span {
    width: 24px;
    height: 2px;
    display: block;
    background: var(--text);
    transition:
      transform 0.2s ease,
      opacity 0.2s ease;
  }

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .global-nav {
    position: absolute;
    top: 62px;
    left: 50%;
    width: 100vw;
    margin-left: 0;
    padding: 10px 6% 18px;

    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0;

    transform: translateX(-50%);
    white-space: normal;

    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  }

  .global-nav.is-open {
    display: flex;
  }

  .global-nav a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 0.95rem;
  }

  .global-nav a:last-child {
    border-bottom: 0;
  }


  /* =========================
     HERO
  ========================= */

  .hero {
    min-height: 360px;
    height: 58vh;
  }

  .hero-copy {
    left: 6%;
    bottom: 14%;
    width: 86%;
  }

  .hero-dots {
    right: 6%;
    bottom: 7%;
  }


  /* =========================
     SECTIONS
  ========================= */

  .section,
  .intro-section {
    padding: 54px 0;
  }

  .section-heading {
    align-items: flex-start;
  }


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

  .news-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }


  /* =========================
     PROFILE
  ========================= */

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    min-height: auto;
    max-height: 420px;
  }

  .profile-content {
    padding: 26px;
  }


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

  .publication-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }


  /* =========================
     X SIDEBAR
  ========================= */

  .x-column {
    width: 100%;
    padding: 0 0 54px;
  }

  .x-timeline-wrap {
    width: 100%;
  }


  /* =========================
     FOOTER
  ========================= */

  .footer-inner {
    flex-direction: column;
  }
}


/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}