/* ==========================================================================
   Koharu Saeki — Portfolio
   Editorial / minimal, page-switching layout (inspired by 0x1.company)
   ========================================================================== */

:root {
  --bg: #f9f8f9;
  --ink: #08131a;          /* headings — near black */
  --text: #46433f;         /* body */
  --muted: #9a938f;        /* meta / inactive nav */
  --faint: #bcb6b1;        /* very light meta */
  --line: rgba(8, 19, 26, 0.10);
  --line-soft: rgba(8, 19, 26, 0.06);
  --accent: #e23a7a;       /* the one color — a refined pink */
  --accent-soft: rgba(226, 58, 122, 0.14);

  --serif: 'EB Garamond', 'Times New Roman', serif;
  --sans: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Zen Kaku Gothic New',
          -apple-system, BlinkMacSystemFont, 'Yu Gothic', 'Meiryo', sans-serif;

  --sidebar-w: clamp(300px, 34vw, 500px);
  --content-max: 880px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.25rem;           /* 20px */
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); color: var(--ink); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  z-index: 2000;
}
.skip-link:focus { left: 0; }

a { color: inherit; }

/* ==========================================================================
   SIDEBAR (fixed, left) — wider column
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 48px 56px;
  z-index: 100;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 44px;
  width: 100%;
}

.brand { text-decoration: none; display: block; line-height: 1; }

.brand-name {
  display: block;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.1;
  white-space: nowrap;
}

.brand-jp {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.88rem;
  letter-spacing: 0.34em;
  color: var(--muted);
  margin-top: 15px;
  padding-right: 0.1em;
}

.site-nav ul { list-style: none; }
.site-nav li { margin: 4px 0; }

.site-nav a {
  font-family: var(--serif);
  font-size: 1.125rem;         /* 18px */
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
  position: relative;
}
.site-nav a:hover { color: var(--ink); }

.site-nav a.is-active { color: var(--ink); font-weight: 600; }

.site-nav a.is-active::after {
  content: '';
  position: absolute;
  right: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.socials {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 22px;
}

.socials a {
  color: var(--muted);
  display: flex;
  text-decoration: none;
  transition: color 0.2s ease;
}
.socials a:hover { color: var(--accent); }

.socials svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.contact-email {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  word-break: break-all;
}

/* ==========================================================================
   MOBILE TOP BAR (hidden on desktop)
   ========================================================================== */
.mobilebar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(249, 248, 249, 0.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
  z-index: 200;
}

.mobilebar-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}

.mobilebar-right { display: flex; align-items: center; gap: 16px; }

.responsive_btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   MAIN / CONTENT — one "page" visible at a time, centered in the space
   right of the sidebar
   ========================================================================== */
main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page { display: none; }

.page.is-current {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: var(--content-max);
  margin: 0;                    /* flush to the sidebar, not centered */
  padding: clamp(72px, 12vh, 132px) 40px 96px 52px;
  animation: pageIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .page.is-current { animation: none; }
}

/* ── HERO (Home) ────────────────────────────────────── */
.hero-photo { width: min(360px, 74%); margin-bottom: 46px; }

.hero-photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  filter: saturate(0.94);
  display: block;
}

.hero-headline {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2rem, 2.7vw, 2.4rem);   /* ~38px */
  line-height: 1.35;
  letter-spacing: normal;
  color: var(--ink);
  margin-bottom: 28px;
}

/* The greeting sits on its own line, quieter than the name below it */
.hero-greeting {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.42em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-lead {
  font-size: 1.25rem;
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  margin-bottom: 36px;
}

.hero-about {
  margin-bottom: 36px;
}
.hero-about p {
  font-size: 1.1875rem;
  color: var(--text);
  line-height: 1.95;
  margin-bottom: 10px;
}
.hero-about p:last-child { margin-bottom: 0; }

.hero-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.hero-tags li {
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 6px 15px;
  border: 1px solid var(--line);
  border-radius: 100px;
}

/* ── SECTION HEADINGS ───────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 44px;
}

.section-index {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.16em;
  padding-top: 0.5em;
}

.section-head h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2rem, 2.9vw, 2.4rem);   /* ~38px */
  letter-spacing: normal;
  color: var(--ink);
  line-height: 1.15;
}

/* ── ABOUT ──────────────────────────────────────────── */
.section-body > p { margin-bottom: 16px; font-size: 1.25rem; line-height: 1.6; }
.section-body > p:last-child { margin-bottom: 0; }

.lead-jp {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem !important;
  color: var(--ink);
  margin-bottom: 22px !important;
  letter-spacing: 0.02em;
}

/* ── SKILL ──────────────────────────────────────────── */
.skill-grid { display: flex; flex-direction: column; }

.skill-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.skill-row:first-child { border-top: 1px solid var(--line-soft); }

.skill-row dt {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.skill-row dd {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}

/* ── RESEARCH TAGS ──────────────────────────────────── */
.tagline {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 46px;
}
.tagline li {
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ── SECTION PHOTO ──────────────────────────────────── */
.section-body > p.section-lead {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 24px;
}

.section-body > p.section-note { font-weight: 500; }

.section-photo {
  width: min(560px, 100%);
  margin: 0 0 28px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: 0 10px 34px rgba(8, 19, 26, 0.10);
}
.section-photo img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── VIDEO EMBED ────────────────────────────────────── */
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 20px 0 40px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  box-shadow: 0 10px 34px rgba(8, 19, 26, 0.10);
  background: #000;
}
.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ── ENTRIES (timeline / CV list) ───────────────────── */
.entries { display: flex; flex-direction: column; }

.entry {
  padding: 30px 0;
  border-top: 1px solid var(--line-soft);
}
.entry:last-child { border-bottom: 1px solid var(--line-soft); }

.entry-meta {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.entry-note {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.entry-title {
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.45;
  font-weight: 400;
}
.entry-title strong { font-weight: 400; }

.entry-at { font-weight: 400; color: var(--ink); }

/* Research: emphasize only the author's own name */
#research .entry-title strong { font-weight: 600; }

.entry-sub {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.6;
  margin-top: 4px;
}

.entry-desc {
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.6;
  margin-top: 4px;
}

.entry-links {
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.entry-tags .tag {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: 100px;
}

/* ── LINKS in content ───────────────────────────────── */
.section-body a,
.hero-lead a,
.hero-about a,
.entry-links a {
  color: inherit;                       /* same color as the surrounding text */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(8, 19, 26, 0.4);
  border-bottom: none;
  transition: text-decoration-color 0.2s ease;
}
.section-body a:hover,
.hero-lead a:hover,
.hero-about a:hover,
.entry-links a:hover { text-decoration-color: currentColor; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 56px;
  padding-top: 28px;
}

.copyright {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--faint);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  :root { --sidebar-w: clamp(280px, 32vw, 380px); }
  .sidebar { padding: 44px 40px; }
}

@media (max-width: 860px) {
  .mobilebar { display: flex; }

  main {
    margin-left: 0;
    min-height: auto;
  }

  .page.is-current {
    min-height: auto;
    justify-content: flex-start;
    max-width: 100%;
    padding: 92px 24px 72px;
  }

  .hero-photo { width: min(280px, 68%); margin-bottom: 38px; }

  /* The sidebar becomes a full-screen slide-in menu on mobile */
  .sidebar {
    width: 100%;
    height: 100vh;
    padding: 58px 24px 32px;
    background: rgba(249, 248, 249, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: center;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 190;
  }
  .sidebar.menu_active { transform: translateX(0); }

  .sidebar-inner { align-items: center; text-align: center; gap: 26px; }
  .brand { display: none; }
  .sidebar .socials { justify-content: center; }

  .site-nav ul { text-align: center; }
  .site-nav li { margin: 12px 0; }
  .site-nav a { font-size: 1.9rem; }
  .site-nav a.is-active::after { display: none; }

  .entry { padding: 24px 0; }

  .skill-row { grid-template-columns: 120px 1fr; gap: 16px; }
}

@media (max-width: 480px) {
  .page.is-current { padding: 88px 18px 64px; }
  .skill-row { grid-template-columns: 1fr; gap: 6px; }
}
