/*
 * Lina Yamaya website — 共通スタイル
 *
 * 更新する場所
 * 01 配色・文字サイズ    : 色やスマホの文字サイズを変えるとき
 * 04 HOME              : 写真・プロフィール・Keywords・News
 * 05 CV                : 学歴・経歴・受賞歴
 * 06 Publications      : 論文・Preprints・DOI
 * 08–09 レスポンシブ    : 小さい画面だけのレイアウト
 *
 * 画面幅
 *   821px 以上 : PCの横並びメニュー
 *   820px 以下 : ハンバーガーメニュー・HOMEの縦並び
 *   700px 以下 : スマホの余白・CV / Publicationsの小さめ文字
 *
 * メニューの境界（820px）は menu.js の MOBILE_QUERY と揃えてください。
 * !important による上書きは使わず、後半のメディアクエリへ整理しています。
 */

/* ==========================================================================
   01. 配色・基本設定
   ========================================================================== */

:root {
  /* 文字色：背景・装飾の淡さは保ち、文字だけ濃くしています。 */
  --ink: #3f5875;
  --heading-ink: #425a78;
  --text: #4f5d6d;
  --muted: #5f6c80;
  --accent-text: #6d5689;
  --accent-hover: #5b4475;

  /* 装飾色：小さい文字には使わず、線や背景に使用します。 */
  --accent: #9a78bf;
  --pink: #e5a5c8;
  --line: #ebe4f1;
  --panel-line: #eee7f4;
  --white: #ffffff;
  --soft: #faf7fc;

  /* Keywordsは全項目とも同じラベンダーです。 */
  --keyword-background: #f1ecfa;
  --keyword-border: #dfd5f0;
  --keyword-text: #5c688c;

  /* 各ページで共用するグラデーション */
  --title-rule: linear-gradient(90deg, #9279c5, #e5a5c8);
  --section-rule: linear-gradient(90deg, #a287ca, #e5a0c5);
  --page-background:
    radial-gradient(circle at 82% 20%, rgba(242, 203, 229, .25), transparent 24%),
    linear-gradient(135deg, #faf8ff 0%, #f4effc 52%, #fff5fa 100%);
  --footer-background:
    linear-gradient(180deg, #f8f5fc, #f3eef9 58%, #fff6fa);

  --max: 1120px;
  --font-body:
    -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;

  /* スマホ用：この値を変えても、PC側の文字サイズは変わりません。 */
  --mobile-portrait-width: 160px;
  --phone-page-title: clamp(2rem, 8vw, 2.25rem);
  --phone-section-title: 1.375rem;
  --phone-body-text: .9375rem;
  --phone-small-text: .875rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--white);
  font-family: var(--font-body);
  line-height: 1.7;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
}

/* 長いDOIやメールアドレスでページ幅が広がるのを防ぎます。 */
.contact a,
.cv-item {
  overflow-wrap: anywhere;
}

/* ==========================================================================
   02. 共通ヘッダー・ナビゲーション
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(235, 228, 241, .9);
}

.page-home .site-header {
  border-bottom-color: rgba(220, 230, 238, .85);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: var(--max);
  min-height: 72px;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  color: var(--ink);
  font-size: 1.28rem;
  letter-spacing: .02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  color: #536474;
  font-size: .9rem;
  letter-spacing: .04em;
}

.nav-links a.active {
  color: var(--accent-text);
  font-weight: 600;
}

.menu-toggle {
  display: none;
}

/* ==========================================================================
   03. 共通のページ見出し・本文・フッター
   ========================================================================== */

.page-hero {
  padding: 68px 28px 62px;
  text-align: center;
  background: var(--page-background);
  border-bottom: 1px solid var(--panel-line);
}

.page-hero h1 {
  margin: 0;
  color: var(--heading-ink);
  font-family: var(--font-heading);
  font-size: clamp(3rem, 7vw, 4.6rem);
  font-weight: 400;
  letter-spacing: .04em;
}

.page-hero .rule {
  width: 52px;
  height: 2px;
  margin: 18px auto 0;
  background: var(--title-rule);
}

.page-content {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 28px 96px;
}

.section-title {
  margin: 0 0 26px;
  color: var(--accent-text);
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -.02em;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 12px;
  background: var(--section-rule);
}

.site-footer {
  padding: 42px 28px 46px;
  color: #496273;
  background: var(--footer-background);
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
}

.footer-name {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 1.15rem;
}

.footer-small {
  font-size: .87rem;
}

/* ==========================================================================
   04. HOME — 写真・プロフィール・Keywords・News
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 470px;
  overflow: hidden;
  /* 雪山の写真。HTMLと同じフォルダに置く名前をここで指定します。 */
  background:
    linear-gradient(
      90deg,
      rgba(250, 246, 252, .90) 0%,
      rgba(246, 241, 251, .58) 42%,
      rgba(255, 244, 249, .16) 72%
    ),
    url("58BFEE09-DA8B-4A60-881E-9E810A1FEA80.jpg") center 58% / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .78));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 56px));
  margin: 0 auto;
  padding: 70px 0 92px;
}

.hero-copy {
  max-width: 590px;
}

.hero h1 {
  margin: 0;
  color: var(--heading-ink);
  font-family: var(--font-heading);
  font-size: clamp(3rem, 7vw, 5.7rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: .025em;
}

.hero .jp-name {
  margin-top: 16px;
  color: #61718a;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  letter-spacing: .12em;
}

.hero .rule {
  width: 54px;
  height: 1px;
  margin: 22px 0 18px;
  background: var(--title-rule);
}

/* 現在HTMLでコメントアウト中のキャッチコピー用です。 */
.hero .tagline {
  max-width: 560px;
  margin: 0;
  color: #5a6c84;
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  line-height: 1.55;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 78px 28px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  align-items: start;
  gap: 62px;
}

.about-grid > * {
  min-width: 0;
}

.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
  border-radius: 24px;
  background: #edf2f5;
  box-shadow: 0 16px 40px rgba(29, 59, 82, .10);
}

.page-home .section-title {
  margin-bottom: 24px;
}

.page-home .section-title::after {
  background: var(--accent);
}

.about-text p {
  max-width: 690px;
  margin: 0 0 18px;
  font-size: 1.03rem;
}

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
  margin-top: 30px;
  padding-top: 25px;
  color: #49606f;
  border-top: 1px solid var(--line);
  font-size: .95rem;
}

.contact a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.keywords-wrap {
  background: var(--white);
}

.keywords-panel {
  padding: 34px 36px;
  border: 1px solid var(--panel-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 20%, rgba(242, 203, 229, .26), transparent 25%),
    linear-gradient(135deg, #faf8ff 0%, #f4effc 52%, #fff5fa 100%);
  box-shadow: 0 10px 28px rgba(112, 92, 145, .05);
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
}

.keyword {
  padding: 10px 18px;
  color: var(--keyword-text);
  border: 1px solid var(--keyword-border);
  border-radius: 999px;
  background: var(--keyword-background);
  font-size: .96rem;
  box-shadow: 0 5px 14px rgba(96, 79, 135, .05);
}

.news-wrap {
  border-top: 1px solid var(--panel-line);
  border-bottom: 1px solid var(--panel-line);
  background:
    radial-gradient(circle at 88% 26%, rgba(244, 195, 226, .28), transparent 28%),
    linear-gradient(135deg, #faf8ff 0%, #f4effc 48%, #fff4f9 100%);
}

#news .section-title::after {
  background: var(--section-rule);
}

.news-list {
  max-width: 760px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.news-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid #e4ebf0;
}

.news-list li:last-child {
  border-bottom: 0;
}

.news-date {
  color: var(--muted);
  font-size: .9rem;
}

.news-date::before {
  content: "●";
  margin-right: 10px;
  color: #e8b3d1;
  font-size: .55rem;
  vertical-align: middle;
}

.news-text {
  color: #3a4b58;
}

.page-home .footer-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}

.footer-motto {
  color: var(--muted);
  font-family: var(--font-heading);
  font-style: italic;
  text-align: right;
}

/* ==========================================================================
   05. CV — Education / Professional Experience / Awards & Honors
   ========================================================================== */

.cv-section {
  margin-bottom: 30px;
  padding: 34px 38px 40px;
  border: 1px solid var(--panel-line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(112, 92, 145, .05);
}

.cv-section:nth-child(even) {
  background:
    radial-gradient(circle at 94% 14%, rgba(242, 203, 229, .16), transparent 25%),
    linear-gradient(135deg, #fff 0%, #fcfaff 100%);
}

.cv-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cv-list li {
  display: grid;
  grid-template-columns: 185px 1fr;
  gap: 24px;
  padding: 15px 0;
  border-bottom: 1px solid #f0ebf4;
}

.cv-list li:last-child {
  border-bottom: 0;
}

.cv-date {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.cv-item {
  min-width: 0;
  color: #465565;
}

/* ==========================================================================
   06. Publications — Papers / Preprints
   ========================================================================== */

.pub-panel {
  padding: 34px 38px 40px;
  border: 1px solid var(--panel-line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 10px 28px rgba(112, 92, 145, .05);
}

.pub-panel + .pub-panel {
  margin-top: 30px;
}

.page-publications .section-title {
  letter-spacing: normal;
}

.pub-list {
  margin: 0;
  padding-left: 1.7rem;
}

.pub-list li {
  padding: 19px 0 21px 8px;
  border-bottom: 1px solid #f0ebf4;
}

.pub-list li:last-child {
  border-bottom: 0;
}

.pub-title {
  color: var(--heading-ink);
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.55;
}

.pub-title a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: #d8cbe8;
  text-underline-offset: 4px;
}

.pub-title a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--pink);
}

.authors {
  margin-top: 4px;
  color: var(--muted);
}

.journal {
  margin-top: 2px;
  color: #465565;
}

.doi-link {
  display: inline-block;
  margin-left: 8px;
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: #d8cbe8;
  text-underline-offset: 3px;
}

.doi-link:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--pink);
}

.me {
  color: #5d5681;
  font-weight: 700;
}

/* ==========================================================================
   07. Research / Presentations — Coming Soon
   ========================================================================== */

.page-coming .page-content {
  padding-top: 82px;
  padding-bottom: 110px;
}

.coming-card {
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 42px;
  text-align: center;
  border: 1px solid var(--panel-line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 88% 20%, rgba(244, 195, 226, .20), transparent 28%),
    linear-gradient(135deg, #fff 0%, #faf8ff 52%, #fff6fa 100%);
  box-shadow: 0 12px 32px rgba(112, 92, 145, .06);
}

.coming-card h2 {
  margin: 0 0 16px;
  color: var(--accent-text);
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
}

.coming-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ==========================================================================
   08. タブレット・スマホ共通（820px以下）
   ========================================================================== */

@media (max-width: 820px) {
  /* HOME：写真と紹介文を縦にし、顔写真は160pxを維持します。 */
  .hero {
    min-height: 420px;
    background-position: 58% center;
  }

  .hero-inner {
    width: min(calc(100% - 36px), var(--max));
    padding: 56px 0 74px;
  }

  .hero-copy {
    max-width: 78%;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .portrait {
    display: block;
    width: var(--mobile-portrait-width);
    max-width: 100%;
    height: auto;
    margin: 0 auto;
  }

  .contact {
    grid-template-columns: 1fr;
  }

  .page-home .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-motto {
    text-align: left;
  }

  /* ナビゲーション：JavaScriptが無効でもリンクは表示されます。 */
  .site-header {
    overflow: visible;
  }

  .nav {
    position: relative;
    flex-wrap: wrap;
    min-height: 62px;
    gap: 0;
    padding: 9px 18px;
  }

  .brand {
    font-size: 1.12rem;
  }

  .nav-links {
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 2px;
    padding: 8px 0;
    overflow: visible;
    white-space: normal;
    font-size: .88rem;
  }

  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .nav-links a:hover,
  .nav-links a:focus-visible {
    color: var(--accent-text);
    background: #f5effa;
  }

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

  .nav.menu-ready .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    margin: 0 0 0 12px;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    color: var(--accent-text);
    border: 1px solid #e4d9ef;
    border-radius: 12px;
    background: #f7f2fc;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .menu-toggle:hover,
  .menu-toggle[aria-expanded="true"] {
    background: #eee6f8;
  }

  .menu-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 16px;
  }

  .menu-icon span {
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
  }

  .menu-icon span:nth-child(1) {
    top: 0;
  }

  .menu-icon span:nth-child(2) {
    top: 7px;
  }

  .menu-icon span:nth-child(3) {
    top: 14px;
  }

  .menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle[aria-expanded="true"] .menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav.menu-ready .nav-links {
    position: absolute;
    z-index: 30;
    top: calc(100% + 8px);
    left: 14px;
    right: 14px;
    width: auto;
    max-height: calc(100vh - 90px);
    max-height: calc(100dvh - 90px);
    margin: 0;
    padding: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e7ddf1;
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #faf7ff 65%, #fff6fa 100%);
    box-shadow: 0 12px 32px rgba(83, 63, 112, .13);
  }

  .nav.menu-ready .nav-links[hidden] {
    display: none;
  }
}

/* ==========================================================================
   09. スマホ（700px以下）
   ========================================================================== */

@media (max-width: 700px) {
  .page-hero {
    padding: 43px 18px 39px;
  }

  .page-hero h1 {
    font-size: clamp(2.45rem, 13vw, 3.4rem);
  }

  .page-content,
  .home-content {
    padding-left: 17px;
    padding-right: 17px;
  }

  .site-footer {
    padding: 32px 20px 36px;
  }

  /* HOME */
  .hero {
    min-height: 420px;
    background-position: 64% center;
  }

  .hero-inner {
    width: calc(100% - 36px);
    padding: 58px 0 72px;
  }

  .hero-copy {
    max-width: 90%;
  }

  .hero h1 {
    font-size: clamp(3rem, 16vw, 4.4rem);
    line-height: 1;
  }

  .hero .jp-name {
    font-size: 1.25rem;
  }

  .section {
    padding: 52px 18px;
  }

  .about-grid {
    gap: 30px;
  }

  .contact {
    gap: 16px;
  }

  .keywords-panel {
    padding: 27px 22px;
  }

  .keyword-cloud {
    gap: 9px;
  }

  .keyword {
    padding: 8px 13px;
    font-size: .88rem;
  }

  .news-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  /* CVとPublications：前回調整した小さめ文字を維持します。 */
  .page-reading .page-hero {
    padding: 32px 18px 28px;
  }

  .page-reading .page-hero h1 {
    font-size: var(--phone-page-title);
    line-height: 1.3;
    letter-spacing: .02em;
  }

  .page-reading .page-hero .rule {
    margin-top: 14px;
  }

  .page-reading .page-content {
    padding-top: 32px;
    padding-bottom: 48px;
  }

  .page-reading .section-title {
    margin-bottom: 18px;
    font-size: var(--phone-section-title);
    line-height: 1.4;
  }

  .page-reading .section-title::after {
    width: 40px;
    margin-top: 10px;
  }

  /* CV */
  .cv-section {
    padding: 26px 20px 29px;
    border-radius: 20px;
  }

  .cv-list {
    font-size: var(--phone-body-text);
    line-height: 1.65;
  }

  .cv-list li {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 12px 0;
  }

  .cv-date {
    font-size: var(--phone-small-text);
    line-height: 1.5;
  }

  .cv-item {
    font-size: var(--phone-body-text);
    line-height: 1.65;
  }

  /* Publications */
  .pub-panel {
    padding: 25px 19px 29px;
    border-radius: 20px;
  }

  .pub-list {
    padding-left: 1.35rem;
    font-size: var(--phone-body-text);
  }

  .pub-list li {
    padding: 14px 0 16px 4px;
  }

  .pub-title {
    font-size: var(--phone-body-text);
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .authors,
  .journal {
    font-size: var(--phone-small-text);
    line-height: 1.65;
    overflow-wrap: anywhere;
  }

  .doi-link {
    display: inline;
    margin-left: 0;
    overflow-wrap: anywhere;
  }
}

/* Coming Soonページの余白は既存の小型画面設定を維持しています。 */
@media (max-width: 620px) {
  .page-coming .page-content {
    padding-top: 56px;
    padding-bottom: 82px;
  }

  .coming-card {
    padding: 54px 24px;
  }
}

/* アニメーションを抑える設定がある場合は、メニューの変形を省きます。 */
@media (prefers-reduced-motion: reduce) {
  .menu-icon span {
    transition: none;
  }
}
