/* =========================================================
   Kengo Sakurai — Personal Webpage
   Clean academic design, bilingual (EN/JA), responsive
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f3f7f3;
  --color-text: #1c1c1c;
  --color-muted: #5a625a;
  --color-subtle: #8a8a8a;
  --color-border: #d9e2d8;
  --color-accent: #2d6a4f;        /* deep emerald */
  --color-accent-hover: #40916c;  /* medium green */
  --color-accent-soft: #b7e4c7;   /* light sage */
  --color-link: #2d6a4f;

  --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-ja: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --font-display: 'Nunito', 'Quicksand', system-ui, sans-serif;

  --container-max: 1080px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;

  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 70px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lang-ja {
  font-family: var(--font-ja);
}

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 0.5em;
}

a {
  color: var(--color-link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover { border-bottom-color: var(--color-accent); }

p { margin: 0 0 1em; }

ul, ol { margin: 0 0 1em; padding-left: 1.4em; }

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Language toggle ---------- */
body.lang-en .lang-ja { display: none !important; }
body.lang-ja .lang-en { display: none !important; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--color-text);
  border-bottom: none;
}
.site-title:hover { color: var(--color-accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.4rem;
}

.nav-list a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-muted);
  border-bottom: none;
  padding: 4px 0;
  position: relative;
}
.nav-list a:hover { color: var(--color-text); }
.nav-list a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.2s ease;
}
.nav-list a:hover::after { width: 100%; }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.lang-toggle:hover {
  background-color: var(--color-bg-alt);
  border-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  margin: 0 auto;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Soy banner (top of page, header-like strip) ---------- */
.soy-banner {
  background-color: #ffffff;
  padding: 0.75rem 0 0.5rem;
  text-align: center;
}
.soy-banner img {
  display: block;
  margin: 0 auto;
  max-width: 720px;
  width: 90%;
  height: auto;
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-4) 0 var(--space-5);
  background-color: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.25rem;
}

.hero-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(45, 106, 79, 0.2);
  flex-shrink: 0;
}

.hero-identity-text {
  min-width: 0;
  flex: 1;
}

.hero-mascot {
  width: auto;
  height: 110px;
  flex-shrink: 0;
  align-self: center;
}
.hero-top {
  height: 165px;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.15rem;
  line-height: 1.15;
}
body.lang-ja .hero-name { font-family: var(--font-ja); }

.hero-degree {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.03em;
  margin: 0 0 0.2rem;
}

.hero-title {
  font-size: 1rem;
  color: var(--color-muted);
  margin: 0;
  font-weight: 500;
}

.hero-affiliation {
  color: var(--color-muted);
  line-height: 1.65;
  margin: 0 0 1.4rem;
}

.hero-contact {
  margin: 0 0 1.4rem;
  padding: 1rem 1.2rem;
  background-color: #ffffff;
  border-left: 3px solid var(--color-accent);
  border-radius: 4px;
  font-size: 0.9rem;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0.35rem 1rem;
  align-items: baseline;
}
.hero-contact dt {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-contact dd {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--color-accent-hover);
  border-bottom-color: transparent;
}
.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ---------- Video section ---------- */
.video-placeholder {
  max-width: 900px;
  margin: 1.5rem auto 1rem;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #2d6a4f 0%, #40916c 50%, #74c69d 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(45, 106, 79, 0.2);
  position: relative;
  overflow: hidden;
}
.video-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
                    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.video-placeholder-inner {
  position: relative;
  padding: 2rem;
  max-width: 540px;
}
.video-placeholder svg {
  opacity: 0.85;
  margin-bottom: 0.75rem;
}
.video-placeholder-label {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}
.video-placeholder-sub {
  font-size: 0.95rem;
  opacity: 0.92;
  line-height: 1.55;
  margin: 0;
}
.video-credit {
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-subtle);
  margin: 0.5rem 0 0;
}
.video-credit-note {
  max-width: 720px;
  margin: 1rem auto 0;
  padding: 1.1rem 1.4rem;
  background: #ffffff;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.8;
  box-shadow: 0 2px 8px rgba(45, 106, 79, 0.06);
}
.video-credit-note-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-accent);
  margin: 0 0 0.6rem;
  letter-spacing: 0.02em;
}
.video-credit-note p {
  margin: 0 0 0.55rem;
}
.video-credit-note p:last-child {
  margin-bottom: 0;
}
.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  text-decoration: none;
}
.instagram-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}
.instagram-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .video-placeholder-label { font-size: 1.05rem; }
  .video-placeholder-sub { font-size: 0.85rem; }
  .video-placeholder-inner { padding: 1.25rem; }
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
}
.section-alt { background-color: var(--color-bg-alt); }

/* Collapsible details/summary */
.section-details {
  border: none;
}
.section-details > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  outline: none;
}
.section-details > summary::-webkit-details-marker { display: none; }
.section-details > summary::marker { display: none; }
.section-details > summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Disclosure chevron */
.section-details > summary::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border-right: 2.5px solid var(--color-accent);
  border-bottom: 2.5px solid var(--color-accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -2px;
}
.section-details[open] > summary::before {
  transform: rotate(45deg);
  margin-top: -6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0;
}
body.lang-ja .section-title { font-family: var(--font-ja); }

.section-icon {
  width: auto;
  height: 56px;
  flex-shrink: 0;
}
.section-icon-lg {
  height: 84px;
}

.section-title-text {
  display: block;
  flex: 1;
  min-width: 0;
  padding-bottom: 0.5rem;
}
.section-title-text::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background-color: var(--color-accent);
  margin-top: 0.5rem;
}

.section-body {
  margin-top: 1.25rem;
}

.section-body-with-figure {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 2rem;
  align-items: start;
}
.section-figure {
  margin: 0;
}
.section-figure img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

/* Stacked layout: prose on top, large figure below */
.section-body-stacked .section-figure-large {
  width: 80%;
  max-width: 960px;
  margin: 1.75rem auto 0;
}

@media (max-width: 820px) {
  .section-body-with-figure {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .section-figure {
    max-width: 480px;
    margin: 0 auto;
  }
  .section-body-stacked .section-figure-large {
    width: 95%;
    max-width: none;
    margin: 1.25rem auto 0;
  }
}

.section-details:hover > summary .section-title-text {
  color: var(--color-accent);
  transition: color 0.15s ease;
}

.section-lead {
  color: var(--color-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.subsection-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2.2rem 0 1rem;
  color: var(--color-text);
}

.prose { max-width: 760px; }
.prose p { font-size: 1rem; color: #2a2a2a; }
.prose h3 { font-size: 1.05rem; margin-top: 1.6rem; }

/* ---------- Tag list ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}
.tag-list li {
  background-color: #fff;
  border: 1px solid var(--color-border);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--color-muted);
}
.section-alt .tag-list li { background-color: #fff; }

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
}
.timeline-item:first-child { border-top: 0; }

.timeline-date {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  padding-top: 0.05rem;
}

.timeline-body p { margin: 0 0 0.4rem; }
.timeline-body p:last-child { margin-bottom: 0; }

.timeline-note {
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ---------- Plain list ---------- */
.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plain-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.plain-list li:last-child { border-bottom: 0; }

/* ---------- Publications ---------- */
.pub-list {
  list-style: none;
  counter-reset: pub;
  padding: 0;
  margin: 0;
}

.pub-item {
  counter-increment: pub;
  padding: 1.2rem 0 1.2rem 2.6rem;
  border-top: 1px solid var(--color-border);
  position: relative;
}
.pub-item:first-child { border-top: 0; }

.pub-item::before {
  content: counter(pub);
  position: absolute;
  left: 0;
  top: 1.2rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-accent);
  font-size: 1.05rem;
  width: 2rem;
}

.pub-item p { margin: 0 0 0.3rem; }
.pub-authors { font-size: 0.92rem; color: var(--color-muted); }
.pub-title { font-weight: 600; color: var(--color-text); font-size: 1rem; line-height: 1.4; }
.pub-venue { font-size: 0.92rem; color: #444; }
.pub-links { margin-top: 0.35rem !important; }
.pub-links a {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: 3px;
  padding: 2px 10px;
  margin-right: 0.4rem;
}
.pub-links a:hover {
  background-color: var(--color-accent);
  color: #fff;
  border-bottom-color: var(--color-accent);
}

/* ---------- Presentations ---------- */
.pres-list {
  list-style: decimal;
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}
.pres-list li {
  padding: 0.55rem 0;
  border-bottom: 1px dotted var(--color-border);
  font-size: 0.93rem;
  color: #2f2f2f;
  line-height: 1.55;
}
.pres-list li:last-child { border-bottom: 0; }
.pres-list li::marker { color: var(--color-subtle); font-weight: 500; }

/* ---------- Courses ---------- */
.course-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.course-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
}
.course-list li:last-child { border-bottom: 0; }
.course-note {
  display: block;
  font-size: 0.88rem;
  color: var(--color-muted);
  margin-top: 0.2rem;
}

/* ---------- Links grid ---------- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background-color: #fff;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.link-card:hover {
  border-color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.link-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.link-id {
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2rem 0;
  background-color: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-copy, .footer-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-subtle);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-name { font-size: 1.85rem; }
  .hero-avatar { width: 60px; height: 60px; }
  .hero-mascot { height: 80px; }
  .hero-top { height: 120px; }
  .hero-contact {
    grid-template-columns: 1fr;
    gap: 0.05rem 0;
  }
  .hero-contact dt { margin-top: 0.4rem; }
  .hero-contact dt:first-child { margin-top: 0; }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .timeline-date {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
  }
  .soy-banner img { width: 92%; max-width: 480px; }
  .section-title { font-size: 1.5rem; }
  .section-icon { height: 44px; }
  .section-icon-lg { height: 66px; }
}

@media (max-width: 560px) {
  .hero-mascot { display: none; }
  .section-icon { height: 38px; }
  .section-icon-lg { height: 57px; }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    order: 3;
  }
  .nav-list {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background-color: #fff;
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    transform: translateY(-110%);
    transition: transform 0.25s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  }
  .nav-list.open { transform: translateY(0); }
  .nav-list li {
    border-bottom: 1px solid var(--color-border);
  }
  .nav-list li:last-child { border-bottom: 0; }
  .nav-list a {
    display: block;
    padding: 0.85rem 0;
    font-size: 1rem;
  }
  .nav-list a::after { display: none; }

  .site-nav { gap: 0.75rem; }

  .section { padding: var(--space-5) 0; }
  .hero { padding: var(--space-5) 0 var(--space-4); }
  .hero-name { font-size: 1.75rem; }
  .section-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .hero-actions, .lang-toggle, .nav-toggle { display: none; }
  body { font-size: 11pt; color: #000; }
  .section { padding: 1rem 0; border-bottom: 1px solid #ccc; }
  a { color: #000; text-decoration: underline; }
}
