/* ============================================================
   moriiLabs — 森
   A studio that sends HTML. The page is set like a technical
   document: one label|content grid, rules instead of boxes,
   and one live measurement as the only piece of proof.

   Type — Shippori Mincho (display) · IBM Plex Sans (body)
          · IBM Plex Mono (data, labels, routes)
   ============================================================ */

:root {
  /* Paper is cool and slightly green — a recycled spec sheet, not cream */
  --paper:      #e9ede6;
  --paper-deep: #dfe5da;
  --ink:        #14211a;
  --ink-soft:   #4a574f;
  --ink-faint:  #5e6a62;
  --forest:     #2f684d;   /* the mark's green — links and structure */
  --rule:       #b4bfae;
  --rule-soft:  #c9d1c4;
  --shu:        #b83c1a;   /* reserved: live-measured figures only */

  --display: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* The one grid the whole page obeys: marginalia | content */
  --spine: 176px;
  --label: 148px;
  --gutter: 40px;
  --measure: 1010px;
  --pad: 32px;
}

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

html {
  scroll-behavior: smooth;
  /* the spine's section marker needs room when jumping to an anchor */
  scroll-padding-top: 96px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--forest); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.skip:focus { left: 0; }

/* ------------------------------------------------------------
   Shared atoms
   ------------------------------------------------------------ */
.label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.glyph { width: 100%; height: auto; }

/* A link that reads as a link without being a button */
.arrow {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--forest);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 3px;
  transition: border-color 0.15s, color 0.15s;
}
.arrow:hover { color: var(--ink); border-bottom-color: var(--shu); }

/* ------------------------------------------------------------
   Spine — fixed left rail: the mark, the routes, and a vertical
   marker naming the section you are currently inside (tategaki).
   ------------------------------------------------------------ */
.spine {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--spine);
  padding: 26px 0 26px var(--pad);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.spine-mark {
  width: 30px;
  color: var(--forest);
  margin-bottom: 46px;
  transition: color 0.2s;
}
.spine-mark:hover { color: var(--ink); }

.spine-nav { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.spine-nav a {
  display: block;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  padding: 5px 0 5px 16px;
  border-left: 1px solid var(--rule-soft);
  transition: color 0.18s, border-color 0.18s, padding-left 0.18s;
}
.spine-nav a:hover { color: var(--ink); border-left-color: var(--forest); }
.spine-nav a.here {
  color: var(--ink);
  border-left-color: var(--shu);
  border-left-width: 2px;
  padding-left: 15px;
}

/* The vertical marker: the studio's name set the way it reads at home */
.spine-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.spine-vert {
  writing-mode: vertical-rl;
  font-family: var(--display);
  font-size: 0.9rem;
  letter-spacing: 0.32em;
  color: var(--ink-faint);
  height: 148px;
}
.spine-vert b { font-weight: 500; color: var(--forest); }

/* ------------------------------------------------------------
   Topbar
   ------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.topbar.stuck { border-bottom-color: var(--rule); }

.topbar-inner {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.wordmark { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.wordmark .kanji { width: 17px; align-self: center; color: var(--forest); }
.wordmark .name {
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.lang { display: inline-flex; gap: 1px; }
.lang button {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 2px 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.lang button:hover { color: var(--ink); }
.lang button.active { color: var(--ink); border-bottom-color: var(--shu); }

.menu-btn {
  display: none;
  width: 34px;
  height: 30px;
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
  position: relative;
}
.menu-btn span {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}
.menu-btn span:nth-child(1) { top: 11px; }
.menu-btn span:nth-child(2) { top: 17px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* Mobile drawer reuses the spine's route list */
.drawer { display: none; }

/* ------------------------------------------------------------
   Page frame + the label|content grid
   ------------------------------------------------------------ */
.frame { margin-left: var(--spine); }

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

.row {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  column-gap: var(--gutter);
}

/* Section scaffolding — one rule, so nothing cancels out later */
.band { padding: 84px 0; border-top: 1px solid var(--rule); }
.band-head { margin-bottom: 44px; }
.band-head h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  line-height: 1.25;
  max-width: 22ch;
}
.band-head .note {
  color: var(--ink-soft);
  font-size: 0.98rem;
  max-width: 54ch;
  margin-top: 14px;
}
.band-head .label { padding-top: 0.62em; }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero { padding: 76px 0 68px; }

.hero .locus { margin-bottom: 26px; }
.hero .locus span + span::before {
  content: "·";
  margin: 0 10px;
  color: var(--rule);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5.1vw, 3.9rem);
  line-height: 1.14;
  max-width: 15ch;
  margin-bottom: 30px;
}
.hero h1 em { font-style: normal; color: var(--forest); }

.hero .lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 50ch;
  margin-bottom: 32px;
}
.hero .lead b { color: var(--ink); font-weight: 600; }

/* The step after the headline: the ask */
.hero-cta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 22px; }

/* Staged entrance: three lines resolving, once, on load */
.rise {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.72s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.rise:nth-child(2) { animation-delay: 0.07s; }
.rise:nth-child(3) { animation-delay: 0.14s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------
   Clients — one quiet line, not a logo wall
   ------------------------------------------------------------ */
.clients { padding: 26px 0; border-top: 1px solid var(--rule); }
.clients .names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  font-family: var(--display);
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.clients .label { padding-top: 0.3em; }

/* The empty seat in the row: legible only once you lean in */
.clients .ghost {
  color: var(--ink-faint);
  text-decoration: none;
  filter: blur(3.5px);
  opacity: 0.75;
  transition: filter 0.28s ease, opacity 0.28s ease, color 0.28s ease;
}
.clients .ghost:hover,
.clients .ghost:focus-visible {
  filter: blur(0);
  opacity: 1;
  color: var(--ink);
}
/* Nothing to hover on a touch screen, and no keyboard either */
@media (hover: none) {
  .clients .ghost { filter: blur(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .clients .ghost { transition: none; }
}

/* ------------------------------------------------------------
   Index — services and products share one row system
   ------------------------------------------------------------ */
.index { border-top: 1px solid var(--rule); }

.entry {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  column-gap: var(--gutter);
  padding: 22px 0;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
  transition: background-color 0.2s;
}
.entry:hover { background: color-mix(in srgb, var(--paper-deep) 55%, transparent); }

.entry h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  line-height: 1.4;
}
.entry p {
  color: var(--ink-soft);
  font-size: 0.96rem;
  margin-top: 6px;
  max-width: 62ch;
}
.entry .label { padding-top: 0.5em; }

/* Stronger than the service keywords: the area is what tells the
   reader whether a project is anything like their own business */
.entry-product .label {
  padding-top: 0.5em;
  color: var(--ink-soft);
  font-weight: 600;
}

.entry-product .head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
.entry-product .status {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------
   Process — a real sequence, marked by stage rather than by a
   promised calendar
   ------------------------------------------------------------ */
.arc { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.arc-stop {
  padding: 26px 18px 0 0;
  border-top: 2px solid var(--ink);
  position: relative;
}
.arc-stop + .arc-stop { border-top-color: var(--rule); }
.arc-stop::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--ink);
}
.arc-stop + .arc-stop::before { background: var(--rule); }
.arc-when {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--shu);
  margin-bottom: 10px;
}
.arc-stop + .arc-stop .arc-when { color: var(--ink-faint); }
.arc-stop h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  margin-bottom: 8px;
}
.arc-stop p { color: var(--ink-soft); font-size: 0.92rem; }

/* ------------------------------------------------------------
   Studio — set as a colophon
   ------------------------------------------------------------ */
.studio-prose p {
  font-size: 1.04rem;
  color: var(--ink-soft);
  max-width: 58ch;
  margin-bottom: 18px;
}
.studio-prose p b { color: var(--ink); font-weight: 600; }

.colophon {
  margin-top: 40px;
  border-top: 1px solid var(--rule);
}
.colophon div {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  column-gap: var(--gutter);
  padding: 13px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.colophon dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.25em;
}
.colophon dd { font-family: var(--display); font-size: 1.02rem; font-weight: 500; }

/* ------------------------------------------------------------
   Stack — a spec line, weighted by what we actually reach for
   ------------------------------------------------------------ */
.spec {
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 2.1;
  color: var(--ink-faint);
  max-width: 64ch;
}
/* Each tier is its own wrapping row, so a multi-word name such as
   "Django REST Framework" breaks between items, never inside one */
.spec b,
.spec i {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}
.spec b span,
.spec i span { white-space: nowrap; }
.spec b { color: var(--ink); font-weight: 500; }
.spec i { font-style: normal; color: var(--ink-soft); }
.spec span::after {
  content: "·";
  margin: 0 10px;
  color: var(--rule);
}
.spec span:last-child::after { content: ""; }
.spec .key::after { content: ""; margin: 0; }
.spec .key {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 18px;
  line-height: 1.9;
}

/* ------------------------------------------------------------
   Contact — the page inverts, once, at the end
   ------------------------------------------------------------ */
.invert {
  background: var(--ink);
  color: var(--paper);
  padding: 92px 0;
  margin-top: 84px;
}
.invert h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.2;
  max-width: 17ch;
  margin-bottom: 22px;
}
.invert p {
  color: #a9b6ac;
  font-size: 1.06rem;
  max-width: 50ch;
  margin-bottom: 34px;
}
.invert .label { color: #7f8d83; }
.invert .mail {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 500;
  color: var(--paper);
  border-bottom: 1px solid #46524a;
  padding-bottom: 6px;
  transition: border-color 0.2s;
}
.invert .mail:hover { border-bottom-color: var(--shu); }
.invert .fineprint {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #7f8d83;
  margin: 26px 0 0;
}
.invert :focus-visible { outline-color: var(--paper); }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.foot { background: var(--ink); color: #7f8d83; padding: 0 0 40px; }
.foot .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  border-top: 1px solid #2a352e;
  padding-top: 24px;
}
.foot a { color: #a9b6ac; font-family: var(--mono); font-size: 0.76rem; }
.foot a:hover { color: var(--paper); }
.foot .copy { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; }
.foot :focus-visible { outline-color: var(--paper); }

/* ------------------------------------------------------------
   Responsive — the spine is the first thing to go
   ------------------------------------------------------------ */
@media (max-width: 1120px) {
  .spine { display: none; }
  .frame { margin-left: 0; }
  .menu-btn { display: block; }

  .drawer {
    display: block;
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid transparent;
    transition: max-height 0.28s ease, border-color 0.28s;
  }
  .drawer.open { max-height: 320px; border-bottom-color: var(--rule); }
  .drawer ul { list-style: none; padding: 10px 0 20px; }
  .drawer a {
    display: block;
    font-family: var(--mono);
    font-size: 0.86rem;
    color: var(--ink-soft);
    padding: 9px 0;
    border-bottom: 1px solid var(--rule-soft);
  }
}

@media (max-width: 880px) {
  :root { --label: 108px; --gutter: 24px; --pad: 22px; }
  .band { padding: 64px 0; }
  .hero { padding: 52px 0 48px; }
  .arc { grid-template-columns: 1fr 1fr; }
  .arc-stop { padding-right: 18px; padding-bottom: 26px; }
}

@media (max-width: 620px) {
  :root { --label: 0px; --gutter: 0px; }
  .row,
  .entry,
  .colophon div { grid-template-columns: minmax(0, 1fr); }
  .row > .label,
  .entry > .label,
  .band-head > .label { margin-bottom: 12px; padding-top: 0; }
  .colophon div { gap: 2px; padding: 15px 0; }
  .arc { grid-template-columns: 1fr; }
  .arc-stop { border-top-color: var(--rule); padding-right: 0; }
  .arc-stop:first-child { border-top-color: var(--ink); }
  .invert { padding: 68px 0; }
  .hero h1 { max-width: none; }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .rise { opacity: 1; transform: none; }
}
