:root {
  --ink: #172129;
  --navy: #173b57;
  --navy-deep: #102b3a;
  --teal: #0d7c86;
  --teal-soft: #d8ece9;
  --coral: #e56b4e;
  --coral-soft: #f6d8cb;
  --sand: #f4f0e6;
  --paper: #fffdf8;
  --line: #d8d4c9;
  --muted: #5b6870;
  --shadow: 0 18px 50px rgba(16, 43, 58, .10);
  --content: 1120px;
  --reading: 820px;
  --radius: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 3%, rgba(229, 107, 78, .10), transparent 28rem),
    linear-gradient(180deg, #f8f5ed 0, var(--sand) 25rem, #f2eee4 100%);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: #076b75; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: #9e3d2b; }
:focus-visible { outline: 3px solid rgba(229, 107, 78, .75); outline-offset: 3px; }

.skip-link {
  position: absolute;
  z-index: 100;
  top: .5rem;
  left: .5rem;
  padding: .6rem 1rem;
  color: #fff;
  background: var(--navy-deep);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 10;
  color: #fff;
  background: var(--navy-deep);
  border-top: 5px solid var(--coral);
}
.site-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--teal) 0 32%, var(--coral) 32% 43%, #f0b35b 43% 46%, transparent 46%);
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(var(--content), calc(100% - 2rem));
  min-height: 76px;
  margin: 0 auto;
  gap: 2rem;
}
.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: #fff;
  text-decoration: none;
  gap: .8rem;
}
.brand:hover { color: #fff; }
.brand-mark {
  position: relative;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  background: var(--teal);
  border-radius: 50% 50% 48% 18%;
  transform: rotate(-8deg);
}
.brand-mark::before,
.brand-mark::after {
  width: 18px;
  height: 4px;
  content: "";
  background: #fff;
  border-radius: 99px;
  box-shadow: 0 8px 0 rgba(255,255,255,.68);
}
.brand-mark::after {
  position: absolute;
  right: -4px;
  top: -3px;
  width: 12px;
  height: 12px;
  background: var(--coral);
  box-shadow: none;
  border: 2px solid var(--navy-deep);
  border-radius: 50%;
}
.brand-word { display: grid; line-height: 1.1; }
.brand-word strong { font-size: 1.18rem; letter-spacing: .025em; }
.brand-word small { margin-top: .3rem; color: #adc9ce; font-family: var(--mono); font-size: .67rem; letter-spacing: .16em; text-transform: uppercase; }
.header-note { color: #bcd3d5; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; white-space: nowrap; }

.site-nav-wrap { background: #fffdf8; border-bottom: 1px solid var(--line); }
.site-nav {
  width: min(var(--content), 100%);
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: thin;
}
.site-nav ul {
  display: flex;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 0 .8rem;
  list-style: none;
}
.site-nav li { display: flex; }
.site-nav a {
  display: block;
  padding: .72rem .78rem .68rem;
  color: #35454f;
  border-bottom: 3px solid transparent;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--coral); }

main { min-height: 60vh; }
.page-shell { width: min(var(--content), calc(100% - 2rem)); margin: 0 auto; }
.page-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  align-items: center;
  min-height: 410px;
  margin: 2rem auto 3rem;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(13,124,134,.19), transparent 50%),
    var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page-hero::before {
  position: absolute;
  top: -100px;
  left: -80px;
  width: 310px;
  height: 310px;
  content: "";
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(255,255,255,.035), 0 0 0 75px rgba(255,255,255,.025);
}
.hero-copy { position: relative; z-index: 1; padding: clamp(2rem, 5vw, 4.5rem); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  margin: 0 0 1rem;
  color: #bce2df;
  font-family: var(--mono);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .12em;
}
.eyebrow::before { width: 26px; height: 2px; margin-right: .65rem; content: ""; background: var(--coral); }
.page-hero h1 {
  max-width: 14em;
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4.4rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.page-hero .hero-summary { max-width: 36em; margin: 1.25rem 0 0; color: #d9e7e8; font-size: .94rem; }
.hero-media { position: relative; align-self: stretch; min-height: 340px; margin: 0; overflow: hidden; }
.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, var(--navy) 0, transparent 24%), linear-gradient(0deg, rgba(16,43,58,.18), transparent 40%);
  pointer-events: none;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-pattern {
  position: relative;
  align-self: stretch;
  min-height: 340px;
  background:
    radial-gradient(circle at 73% 42%, var(--coral) 0 7%, transparent 7.2%),
    radial-gradient(circle at 61% 50%, transparent 0 21%, rgba(255,255,255,.12) 21.3% 21.8%, transparent 22.1%),
    repeating-linear-gradient(135deg, transparent 0 23px, rgba(255,255,255,.055) 24px 25px),
    linear-gradient(145deg, #0b7783, #173b57);
}
.hero-pattern::after {
  position: absolute;
  right: -8%;
  bottom: 15%;
  width: 85%;
  height: 70px;
  content: "";
  border-top: 4px solid rgba(255,255,255,.75);
  border-radius: 50%;
  transform: rotate(-7deg);
}

.breadcrumb { display: flex; flex-wrap: wrap; margin: -1.6rem auto 2rem; padding: 0; list-style: none; color: var(--muted); font-size: .78rem; gap: .4rem; }
.breadcrumb li + li::before { margin-right: .4rem; content: "/"; color: #9aa1a4; }
.breadcrumb a { color: var(--muted); }

.prose {
  width: min(var(--reading), 100%);
  margin: 0 auto 5rem;
  font-size: clamp(1rem, 1.1vw, 1.075rem);
}
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35rem; }
.prose .lead {
  margin: 0 0 2.6rem;
  padding: 0 0 1.8rem 1.25rem;
  color: #30424c;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  font-size: clamp(1.08rem, 1.6vw, 1.25rem);
  line-height: 1.9;
}
.prose h2 {
  position: relative;
  margin: 3.6rem 0 1.25rem;
  padding: 0 0 .7rem 1.05rem;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  line-height: 1.4;
  letter-spacing: -.025em;
}
.prose h2::before { position: absolute; top: .24em; bottom: .7rem; left: 0; width: 4px; content: ""; background: linear-gradient(var(--coral), var(--teal)); border-radius: 9px; }
.prose h3 { margin: 2.25rem 0 .8rem; color: #174b59; font-size: 1.14rem; line-height: 1.55; }
.prose ul, .prose ol { margin: 0 0 1.6rem; padding-left: 1.45rem; }
.prose li { margin: .48rem 0; padding-left: .2rem; }
.prose strong { color: #183e50; }
.prose a[href^="https://"]::after { margin-left: .24em; content: "↗"; font-size: .78em; }
.prose article { margin: 3rem 0; padding: .25rem 1.7rem 1.6rem; background: rgba(255,255,255,.64); border: 1px solid var(--line); border-top: 5px solid var(--teal); border-radius: var(--radius); }

.post-date, .lecture-subtitle, .byline {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .86rem;
  letter-spacing: .03em;
}
.post-date { display: inline-block; margin-bottom: 1.2rem; padding: .3rem .65rem; color: var(--navy); background: var(--teal-soft); border-radius: 2px; }
.lecture-subtitle { margin-bottom: .2rem !important; color: var(--teal); font-size: 1rem; font-weight: 700; }
.byline { margin-bottom: 1.8rem !important; }

.post-index { padding: 0 !important; list-style: none; }
.post-index li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  margin: 0;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  column-gap: 1.2rem;
}
.post-index time { grid-row: 1 / 3; color: var(--muted); font-family: var(--mono); font-size: .78rem; }
.post-index a { font-weight: 750; }
.post-index span { margin-top: .3rem; color: var(--muted); font-size: .9rem; }

.schedule { padding: 0 !important; list-style: none; }
.schedule li { display: grid; grid-template-columns: 7.5rem 1fr; align-items: baseline; padding: .7rem 0; border-bottom: 1px dashed #c9c5ba; gap: .8rem; }
.schedule time { color: #1a6971; font-family: var(--mono); font-size: .78rem; }

table { width: 100%; margin: 1.2rem 0 2rem; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-collapse: collapse; border-radius: var(--radius); }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
th { color: #fff; background: var(--navy); font-size: .85rem; }
tbody tr:nth-child(even) { background: #f5f2e9; }

.page-activities .prose h2 { margin-top: 3rem; padding: .4rem .85rem; color: #fff; background: var(--navy); border: 0; font-family: var(--mono); font-size: 1.05rem; letter-spacing: .08em; }
.page-activities .prose h2::before { display: none; }
.page-activities .prose h3 { position: relative; margin: 0; padding: 1.1rem 1rem .35rem 2.1rem; border-left: 2px solid #9ec8c4; }
.page-activities .prose h3::before { position: absolute; top: 1.55rem; left: -7px; width: 12px; height: 12px; content: ""; background: var(--coral); border: 3px solid var(--sand); border-radius: 50%; }
.page-activities .prose h3 + p { margin: 0; padding: 0 1rem 1.4rem 2.1rem; border-left: 2px solid #9ec8c4; }

.technical .page-shell { --content: 1240px; }
.technical .prose { width: min(980px, 100%); }
.technical .prose section { scroll-margin-top: 1rem; }
.technical .lecture-toc { margin: 2rem 0 3rem; padding: 1.1rem 1.5rem 1.35rem; background: var(--teal-soft); border: 1px solid #b8d8d4; border-radius: var(--radius); }
.technical .lecture-toc h2 { margin-top: .25rem; }
.technical pre { margin: 1.4rem 0 2rem; padding: 1.25rem; overflow-x: auto; color: #d9f2ef; background: var(--navy-deep); border-left: 5px solid var(--coral); border-radius: 4px; font-family: var(--mono); font-size: .78rem; line-height: 1.65; tab-size: 2; }
.technical code { padding: .12em .34em; color: #a83927; background: #eee7d9; border-radius: 3px; font-family: var(--mono); font-size: .88em; overflow-wrap: anywhere; }
.technical pre code { padding: 0; color: inherit; background: transparent; border-radius: 0; font-size: inherit; overflow-wrap: normal; }

.site-footer { color: #d9e6e5; background: var(--navy-deep); border-bottom: 6px solid var(--teal); }
.footer-inner { display: grid; grid-template-columns: 1.2fr .8fr; width: min(var(--content), calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0 2.2rem; gap: 2rem; }
.footer-title { margin: 0 0 .45rem; color: #fff; font-size: 1.15rem; font-weight: 750; }
.footer-strap { margin: 0; color: #a9c9c8; font-family: var(--mono); font-size: .78rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: start; gap: .45rem 1rem; }
.footer-links a { color: #d9e6e5; font-size: .82rem; }
.footer-meta { grid-column: 1 / -1; margin: 1rem 0 0; padding-top: 1rem; color: #86a7a7; border-top: 1px solid rgba(255,255,255,.12); font-size: .75rem; }

.back-top {
  position: fixed;
  z-index: 20;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--teal);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(16,43,58,.2);
  cursor: pointer;
  font: 700 1.1rem/1 var(--sans);
  transition: opacity .2s, transform .2s;
}
.back-top[hidden] { display: none; }
.back-top:hover { transform: translateY(-2px); }

.error-page .page-hero { min-height: 480px; }
.error-code { display: block; margin-bottom: .8rem; color: #bde4df; font: 700 clamp(3.5rem, 10vw, 8rem)/.85 var(--mono); }
.error-page .hero-copy p { max-width: 33rem; color: #d7e6e6; }
.home-link { display: inline-block; margin-top: 1rem; padding: .6rem 1rem; color: #fff; border: 1px solid rgba(255,255,255,.55); border-radius: 3px; font-weight: 700; text-decoration: none; }
.home-link:hover { color: var(--navy-deep); background: #fff; }

@media (max-width: 880px) {
  .header-note { display: none; }
  .page-hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 270px; }
  .hero-media, .hero-pattern { min-height: 280px; }
  .hero-media::after { background: linear-gradient(180deg, var(--navy) 0, transparent 30%); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .footer-meta { grid-column: auto; }
}

@media (max-width: 560px) {
  body { font-size: .96rem; }
  .masthead { min-height: 68px; }
  .brand-word small { display: none; }
  .site-nav a { padding-inline: .65rem; }
  .page-shell { width: min(var(--content), calc(100% - 1.15rem)); }
  .page-hero { margin-top: 1rem; margin-bottom: 2.3rem; }
  .hero-copy { min-height: 245px; padding: 2rem 1.35rem; }
  .hero-media, .hero-pattern { min-height: 220px; }
  .prose .lead { padding-left: .85rem; }
  .prose article { padding-inline: 1rem; }
  .post-index li { grid-template-columns: 1fr; }
  .post-index time { grid-row: auto; }
  .schedule li { grid-template-columns: 1fr; gap: .1rem; }
  table { display: block; overflow-x: auto; }
  .back-top { right: .65rem; bottom: .65rem; }
}

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