:root {
  --bg: #FDFCFA;
  --ink: #2D0914;
  --body-font: "Shippori Mincho";
  --body-weight: 500;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font), "Hiragino Mincho ProN", serif;
  font-weight: var(--body-weight);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

.page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  min-height: 100svh;
}

/* Left: animated mesh + company name */
.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.mesh {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.name {
  position: relative;
  font-family: "EB Garamond", serif;
  font-weight: 400;
  font-size: clamp(44px, 6.4vw, 96px);
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow:
    0 0 4px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg),
    0 0 22px var(--bg), 0 0 34px var(--bg), 0 0 50px var(--bg);
}

/* Right: company info */
.side {
  display: flex;
  flex-direction: column;
  padding: 48px 60px 24px;
}

/* Centered column; keeps at least 32px on both sides (from .side padding). */
.info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding-top: clamp(16px, 8vh, 96px);
}

.nw { white-space: nowrap; }

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

.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  letter-spacing: 0.04em;
  line-height: 1.7;
}

/* Works / Tools / Company menu. The menu stays put; panels below change height freely. */
.tabs {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-bottom: 40px;
}

.tab {
  position: relative;
  padding: 0 0 6px;
  font-family: "EB Garamond", serif;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: rgba(45, 9, 20, 0.72);
  background: none;
  border: 0;
  cursor: pointer;
}

.tab:hover { color: var(--ink); }

.tab[aria-selected="true"] { color: var(--ink); }

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--ink);
}

.tab:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.panel[hidden] { display: none; }

/* Works: vertical timeline (line + dot per entry, oldest first) */
.timeline { list-style: none; }

.timeline li {
  position: relative;
  padding: 0 0 28px 32px;
}

.timeline li::before { /* line */
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: -10px;
  width: 1px;
  background: rgba(45, 9, 20, 0.25);
}

.timeline li:last-child { padding-bottom: 0; }

.timeline li:last-child::before { display: none; }

.timeline li::after { /* dot */
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--bg);
}

.timeline li.current::after { background: var(--ink); }

.when { /* "現在": same size as the industry label */
  font-size: 14px;
  letter-spacing: 0.1em;
  line-height: 1.8;
  color: rgba(45, 9, 20, 0.72);
}

.what { /* industry label: small and gray like the unselected menu */
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: rgba(45, 9, 20, 0.72);
}

.desc {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.8;
}

/* 404 */
h1.lead { font-family: "EB Garamond", serif; font-weight: 400; font-size: 28px; letter-spacing: 0.08em; }

.missing { margin-top: 24px; font-size: 14px; }

.back { margin-top: 32px; font-size: 14px; }

.back a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(45, 9, 20, 0.3);
  padding-bottom: 2px;
}

.back a:hover { border-bottom-color: var(--ink); }

.footer {
  margin-top: 32px;
  text-align: center;
  font-family: "EB Garamond", serif;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(45, 9, 20, 0.75);
}

dl > div {
  display: grid;
  grid-template-columns: 6em 1fr;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid rgba(45, 9, 20, 0.15);
  font-size: 16px;
  align-items: baseline;
}

dl > div:last-child { border-bottom: 1px solid rgba(45, 9, 20, 0.15); }

dt { font-size: 14px; color: rgba(45, 9, 20, 0.75); }

/* Cover: first view is the mesh + name only, with the menu floating near the bottom.
   Choosing a menu item removes .is-cover and shows the split layout. */
.page { position: relative; }

.home { color: inherit; text-decoration: none; }

.page.is-cover { grid-template-columns: 1fr; }

.page.is-cover .side {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12vh;
  bottom: 12svh;
  padding: 0 24px;
}

.page.is-cover .info { padding-top: 0; }

.page.is-cover .tabs { margin-bottom: 0; }

.page.is-cover .tab {
  color: var(--ink);
  text-shadow:
    0 0 4px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg), 0 0 22px var(--bg);
}

.page.is-cover .panels,
.page.is-cover .footer { display: none; }

.page:not(.is-cover) .side { animation: side-in 0.5s ease both; }

@keyframes side-in { from { opacity: 0; } to { opacity: 1; } }

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

/* Dev-only tools (shown with ?dev) */
.dev {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}

.dev[hidden] { display: none; }

.dev {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100vw - 32px);
  font-size: 12px;
}

.t-now { font-variant-numeric: tabular-nums; }

/* Dev: preview of the print export, above the page and below the dev bar */
.dev-preview {
  position: fixed;
  inset: 0 0 72px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(45, 9, 20, 0.08);
  backdrop-filter: blur(6px);
}

.dev-preview[hidden] { display: none; }

.dev-preview .sheet {
  height: min(80vh, calc(90vw / var(--ratio, 1)));
  aspect-ratio: var(--ratio, 1);
  box-shadow: 0 2px 16px rgba(45, 9, 20, 0.15);
}

.dev-preview svg { display: block; width: 100%; height: 100%; }

.dev-note { font-size: 12px; color: rgba(45, 9, 20, 0.75); }

.dev { z-index: 2; }

.save, .font-pick, .pause, .fmt, .print-opt {
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}

/* SP: mesh on top 1/4, info below */
@media (max-width: 767px) {
  .page {
    grid-template-columns: 1fr;
    grid-template-rows: 25vh auto;
    grid-template-rows: 25svh auto;
  }
  .hero { position: relative; height: auto; }
  .page.is-cover { grid-template-rows: 100vh; grid-template-rows: 100svh; }
  .page.is-cover .hero { height: 100%; }
  .name { font-size: clamp(40px, 12vw, 56px); }
  .side { padding: 32px 40px 32px; }
  .info { justify-content: flex-start; }
  dl > div { grid-template-columns: 5em 1fr; gap: 12px; padding: 16px 0; }
  .info { padding-top: 0; }
  .tabs { gap: 32px; margin-bottom: 32px; }
  .tab { font-size: 18px; }
}
