/* yawak.jp — personal site
   Fonts: DM Sans and Zen Kaku Gothic New (SIL Open Font License 1.1), served by Google Fonts. */

:root {
  --bg: #FFFDF5;
  --ivory: #EAE4D1;
  --olive: #6C8650;       /* accents, large text, decoration */
  --olive-ink: #56703C;   /* olive for body-size text (5.5:1 on --bg) */
  --pink: #A87570;        /* accents, underlines */
  --pink-ink: #8C5853;    /* pink for body-size text (5.7:1 on --bg) */
  --text: #35402F;
  --sub: #66695D;
  --rule: #DDD8C8;
  --leaf: #DCE9C8;
  --butter: #F5C96A;

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 960px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-gap: clamp(48px, 8vw, 80px);
  color-scheme: light;
}

.lang-ja {
  --font: "DM Sans", "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
.lang-ja { line-height: 1.8; }

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

a {
  color: var(--olive-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--olive) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
  color: var(--pink-ink);
  text-decoration-color: var(--pink);
  text-decoration-thickness: 2px;
}
a:focus-visible, .skip:focus {
  outline: 2px solid var(--pink-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--bg); padding: 6px 10px; z-index: 10;
}
.skip:focus { left: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- header ---------- */

.site-header { padding: 22px 0 0; }
.header-inner {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: 8px 24px;
}
.logo {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.logo span { color: var(--pink); }
.logo:hover { color: var(--olive-ink); }

.nav {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 4px 20px; font-size: 14.5px;
}
.nav a {
  color: var(--text); text-decoration: none;
  padding: 6px 0;               /* larger tap target */
}
.nav a:hover { color: var(--pink-ink); text-decoration: underline; text-decoration-color: var(--pink); }

.lang { white-space: nowrap; font-weight: 500; letter-spacing: 0.04em; }
.lang-current {
  color: var(--olive-ink); font-weight: 700;
  border-bottom: 2px solid var(--butter);
}
.lang-sep { color: var(--rule); margin: 0 6px; }
.nav .lang-switch { color: var(--sub); }

/* ---------- hero / about ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 32px clamp(32px, 6vw, 72px);
  align-items: center;
  padding-top: clamp(48px, 9vw, 96px);
  padding-bottom: clamp(16px, 3vw, 24px);
}
.hero.no-photo { grid-template-columns: minmax(0, 1fr); }
.hero-text { max-width: 620px; }

.field {
  margin: 0 0 14px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.06em;
  color: var(--pink-ink);
}
.lang-en .field { text-transform: uppercase; font-size: 13px; letter-spacing: 0.1em; }

.name {
  margin: 0;
  font-size: clamp(34px, 5.2vw, 48px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
}
.lang-ja .name { letter-spacing: 0.02em; line-height: 1.2; }
/* small hand-drawn squiggle under the name */
.name::after {
  content: "";
  display: block;
  width: 112px; height: 12px;
  margin-top: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 112 12'%3E%3Cpath d='M2 7c9-6 15 4 24-1s14-6 23 0 15 5 24-1 15-5 24 1 9 2 13-1' fill='none' stroke='%236C8650' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
}
.name-sub {
  margin: 6px 0 0; font-size: 17px; font-weight: 500;
  color: var(--sub); letter-spacing: 0.01em;
}
.role { margin: 22px 0 0; font-size: 17px; font-weight: 500; }
.role a { font-weight: 500; }
.bio { margin: 14px 0 0; max-width: 36em; }
.lang-ja .bio { max-width: 34em; }

.inline-links {
  list-style: none; padding: 0; margin: 20px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  font-size: 15px; font-weight: 500;
}
.inline-links a { display: inline-block; padding: 4px 0; }

.hero-photos {
  position: relative; margin: 0; justify-self: end;
  width: 216px; height: 196px;
}
.hero-photos img { position: absolute; border-radius: 3px; object-fit: cover; }
.photo-main {
  top: 0; right: 0; width: 124px; aspect-ratio: 1;
  object-position: 55% 35%;
  box-shadow: 8px 8px 0 var(--ivory);     /* flat, retro offset */
}
.photo-sub {
  left: 0; bottom: 0; width: 124px; aspect-ratio: 1;
  border: 4px solid var(--bg);
  transform: rotate(-4deg);
}
.hero-photos:not(.two) { height: auto; }
.hero-photos:not(.two) .photo-main { position: static; }

/* ---------- sections ---------- */

.section {
  padding-top: var(--section-gap);
}
.section > .section-title, .site-footer .section-title {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.lang-ja .section-title { letter-spacing: 0.04em; }
.section-title::first-letter { color: var(--olive); }
.lang-ja .section-title::first-letter { color: inherit; }
.lang-ja .section-title::before {
  content: ""; display: inline-block;
  width: 0.42em; height: 0.42em; margin-right: 0.4em;
  vertical-align: 0.12em; border-radius: 50%;
  background: var(--olive);
}
.section-note { margin: 0 0 28px; color: var(--sub); font-size: 14px; }

/* ---------- publications ---------- */

.pub-year {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 0 24px;
  padding: 18px 0 4px;
}
.pub-year + .pub-year { border-top: 1px dashed var(--rule); }
.year {
  margin: 0; font-size: 20px; font-weight: 700;
  color: var(--pink); letter-spacing: -0.01em; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0 14px;
  margin: 0 0 22px; max-width: 50em;
}
/* small study-organism icons (templates/icons/*.svg) */
.pub-icon { width: 34px; height: 34px; margin-top: -3px; }
.pub-icon svg { width: 100%; height: 100%; display: block; overflow: visible; }
.pub-icon .s { fill: none; stroke: var(--olive-ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pub-icon .f { fill: var(--leaf); }   /* after .s so "f s" keeps its fill */
.pub-icon .a { fill: var(--butter); }
.pub-icon .d { fill: var(--text); }
.pub-icon .p { fill: #EBCFC9; stroke: var(--pink-ink); }
.pub-icon .w { fill: none; stroke: var(--pink); stroke-width: 1.2; stroke-linecap: round; }
.pub:hover .pub-icon svg { transform: rotate(-6deg); transition: transform .2s ease; }
.pub p { margin: 0; }
.pub-title { font-size: 17px; font-weight: 500; line-height: 1.45; }
.pub-title a { color: var(--text); text-decoration-color: var(--rule); }
.pub-title a:hover { color: var(--pink-ink); text-decoration-color: var(--pink); }
.pub-authors { margin-top: 4px !important; font-size: 14.5px; color: var(--sub); line-height: 1.55; }
.pub-authors .me { color: var(--text); font-weight: 700; }
.pub-meta { margin-top: 3px !important; font-size: 14px; color: var(--sub); line-height: 1.6; }
.journal { font-style: italic; color: var(--text); }
.lang-ja .journal { font-style: italic; }
.pub-meta a { color: var(--olive-ink); }
.doi { font-variant-numeric: tabular-nums; word-break: break-all; }
.sep { margin: 0 4px 0 6px; color: var(--pink); }
.tag {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--text);
  background: var(--leaf);
  padding: 0 7px; border-radius: 2px;
  line-height: 1.6;
}
.lang-en .tag { text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; }
.footnote { margin: 6px 0 0 160px; font-size: 13px; color: var(--sub); }

/* ---------- CV ---------- */

.cv-block { margin-top: 30px; }
.cv-title {
  margin: 0 0 12px;
  font-size: 17px; font-weight: 700;
  color: var(--olive-ink);
  letter-spacing: 0.01em;
}
.lang-en .cv-title { text-transform: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 0 24px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
.timeline li:last-child { border-bottom: 0; }
.when {
  font-size: 14px; color: var(--sub);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  padding-top: 1px;
}
.what { max-width: 42em; }
.what-main { font-weight: 500; }
.what-sub, .what-org { color: var(--sub); font-size: 15px; }
.what-org { color: var(--text); font-size: inherit; }

/* ---------- activities ---------- */

.activities { margin: 24px 0 0; }
.activities dt { font-size: 19px; font-weight: 700; margin-top: 20px; }
.activities dt:first-child { margin-top: 0; }
.activities dt a { color: var(--text); text-decoration-color: var(--pink); text-decoration-thickness: 2px; }
.activities dt a:hover { color: var(--pink-ink); }
.activities dd { margin: 4px 0 0; max-width: 40em; color: var(--text); }

/* ---------- footer / contact ---------- */

.site-footer {
  margin-top: var(--section-gap);
  padding-bottom: 40px;
}
.email { margin: 14px 0 0; font-size: 16.5px; }
.email .label, .site-footer .inline-links { color: var(--sub); }
.email .label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 10px; }
.email a { font-weight: 500; }
.site-footer .inline-links { margin-top: 10px; }
.contact-links { gap: 6px 24px; }
.contact-links a { display: inline-flex; align-items: center; gap: 7px; }
.brand-icon { display: inline-flex; width: 17px; height: 17px; flex: none; }
.brand-icon svg { width: 100%; height: 100%; }
.copyright {
  margin: 48px 0 0; font-size: 13px; color: var(--sub);
}
.copyright::before {
  content: ""; display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--butter); margin-right: 8px;
  vertical-align: 0.05em;
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-photos { order: -1; justify-self: start; width: 176px; height: 160px; }
  .photo-main { width: 100px; box-shadow: 6px 6px 0 var(--ivory); }
  .photo-sub { width: 100px; }
  .pub-year { grid-template-columns: minmax(0, 1fr); }
  .year { margin-bottom: 6px; }
  .footnote { margin-left: 0; }
  .pub { grid-template-columns: 28px minmax(0, 1fr); gap: 0 10px; }
  .pub-icon { width: 28px; height: 28px; margin-top: -2px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); }
  .when { white-space: normal; }
}

@media (max-width: 420px) {
  .nav { gap: 2px 14px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media print {
  .site-header .nav, .skip { display: none; }
  body { background: #fff; }
  .photo-main { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}
