/* Terakoya.AI site — shared styles for the renewed pages.
   Main colours are the theme's five; gold and leaf green are accents for small marks only. */
:root {
  --navy: #3E4F6D;   /* Primary: logo, buttons */
  --cyan: #009CDC;   /* Secondary: in-app markers */
  --blue: #015E9E;   /* Text: links */
  --ink: #01294A;    /* Accent: rules, headings, navy band */
  --teal: #00AEA9;   /* labels, sources */
  --gold: #F7B04F;   /* accent: current-page underline only */
  --leaf: #8DBF5A;   /* accent: "updated" / "done" dots only */
  --grey: #E5E5E9;
  --band: #01294A;   /* navy bands and dark panels (stays dark in dark mode) */

  --page: #F4F7FA;
  --paper: #FFFFFF;
  --txt: #2B3A4C;
  --sub: #44546A;
  --hair: #D3DAE3;

  --sans: "Montserrat", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--page); color: var(--txt); font-family: var(--sans); font-size: 17px; line-height: 1.9; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.5; text-wrap: balance; word-break: auto-phrase; color: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.in { max-width: var(--max); margin: 0 auto; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.cap { font-size: 12.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: #fff; padding: 8px 12px; z-index: 50; }

/* ---------- header ---------- */
.site-head { background: var(--paper); position: sticky; top: 0; z-index: 30; }
.site-head .in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand span { font-weight: 700; font-size: 21px; color: var(--navy); letter-spacing: .01em; }
.nav { display: flex; align-items: center; gap: 30px; font-size: 13.5px; list-style: none; margin: 0; padding: 0; }
.nav a { text-decoration: none; color: var(--txt); padding-block: 4px; }
.nav a:hover { color: var(--blue); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--gold); }
.nav .lang a { color: var(--sub); }
.menu-btn { display: none; font: inherit; background: none; border: 1px solid var(--hair); padding: 6px 12px; color: var(--ink); cursor: pointer; }

/* masthead strip under the header */
.mast { background: var(--paper); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.mast .in { display: flex; justify-content: space-between; gap: 16px; padding-block: 9px; color: var(--ink); }

/* ---------- buttons and links ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 700; font-size: 17px; padding: 18px 38px; border-radius: 4px; text-decoration: none; border: 1px solid transparent; }
.btn-pri { background: var(--navy); color: #fff; }
.btn-pri:hover { background: var(--band); }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: #E9EFF5; }
.tlink { font-weight: 600; font-size: 17px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.tlink:hover { color: var(--blue); border-color: var(--blue); }
@media (prefers-reduced-motion: no-preference) { .btn, .tlink, .nav a { transition: background .15s, color .15s, border-color .15s; } }

/* ---------- section head: rule + label row ---------- */
.part { padding-block: 96px; }
.shead { display: flex; justify-content: space-between; gap: 16px; border-top: 2px solid var(--ink); padding-top: 10px; color: var(--ink); }
.shead .r { color: var(--sub); }
.part h2 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 700; line-height: 1.45; margin-top: 30px; max-width: 22em; }
.part .sub { margin-top: 12px; color: var(--sub); max-width: 40em; }

/* ---------- hero ---------- */
.hero { background: var(--paper); }
.hero .in { padding-block: 72px 56px; }
.hero .kick { color: var(--teal); }
.hero h1 { font-size: clamp(36px, 6vw, 72px); font-weight: 700; line-height: 1.3; margin-top: 18px; letter-spacing: .01em; }
.hero-sub { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: start; margin-top: 36px; }
.hero .lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--txt); line-height: 1.95; }
.ctas { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; border-top: 1px solid var(--hair); margin-top: 32px; padding-top: 14px; }
.facts .cap { color: var(--sub); font-size: 11.5px; display: block; }
.facts b { display: block; font-weight: 700; color: var(--ink); font-size: 17px; }
/* Stage: the app window sits across a white-to-navy split for a strong first view. */
.stage { background: linear-gradient(var(--paper) 0 38%, var(--band) 38%); padding-bottom: 72px; }
.shot { margin: 0 auto; max-width: 1000px; min-width: 0; }
.stage .figcap { border-color: #5C7896; color: #B9C9DA; margin: 14px 0 0; }
.shot img { width: 100%; }

/* Hero app window: drawn in HTML after the real Terakoya layout, with example data. */
.app { display: grid; grid-template-columns: 168px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); background: var(--paper); border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(1, 41, 74, .45); font-size: 12.5px; line-height: 1.7; color: #1F2733; }
.app svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.app-bar { grid-column: 1 / -1; display: flex; gap: 7px; padding: 10px 14px; }
.app-bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.app-bar i + i { background: #FEBC2E; }
.app-bar i + i + i { background: #28C840; }
.app-side { display: flex; flex-direction: column; min-height: 0; background: #FAFBFC; border-right: 1px solid var(--grey); padding: 4px 8px 12px; }
.app-org { display: flex; align-items: center; gap: 8px; padding: 6px 4px 12px; }
.app-org .mk { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #2F7D5B; color: #fff; font-size: 11px; font-weight: 700; }
.app-org b { display: block; font-size: 11.5px; color: #1F2733; line-height: 1.3; }
.app-org small { display: inline-block; font-size: 9px; font-weight: 600; color: #B26A00; background: #FDF0DA; border-radius: 3px; padding: 0 4px; line-height: 1.6; }
.app-nav, .app-recent { list-style: none; margin: 0; padding: 0; }
.app-nav li, .app-foot div { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; }
.app-nav li.on { background: #EEF0F3; }
.app-side .lbl { margin: 14px 8px 4px; font-size: 10.5px; color: #8A94A3; }
.app-recent li { font-size: 11px; padding: 3px 8px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-recent li.on { background: #EEF0F3; }
.app-foot { margin-top: auto; padding-top: 10px; white-space: nowrap; font-size: 11.5px; }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-top { display: flex; align-items: center; gap: 8px; padding: 6px 16px 10px; border-bottom: 1px solid var(--grey); }
.app-top .r { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 11.5px; }
.app-top .r span { display: flex; align-items: center; gap: 4px; }
.app-news { display: flex; align-items: center; gap: 8px; padding: 6px 16px; background: #F3F7FB; border-bottom: 1px solid var(--grey); font-size: 11.5px; }
.app-news svg { color: var(--cyan); }
.app-chat { flex: 1; position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 12px; }
.app-pill { position: absolute; top: 10px; right: 12px; display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--cyan); border: 1px solid #BFE3F4; border-radius: 999px; padding: 2px 10px; background: #fff; }
.app .q { align-self: flex-end; max-width: 78%; background: #F1F3F6; border-radius: 12px; padding: 6px 12px; margin-top: 26px; }
.app .a p + ul, .app .a ul + p { margin-top: 6px; }
.app .a ul { margin: 0; padding-left: 16px; }
.app .a b { font-weight: 600; }
.app-input { display: flex; align-items: center; gap: 10px; margin: 4px 16px 0; border: 1px solid var(--hair); border-radius: 12px; padding: 5px 6px 5px 6px; color: #9AA6B4; font-size: 11.5px; box-shadow: 0 2px 6px -4px rgba(1, 41, 74, .3); }
.app-input .imp { display: flex; align-items: center; gap: 5px; color: #1F2733; border: 1px solid var(--grey); border-radius: 8px; padding: 2px 8px; }
.app-input .send { margin-left: auto; width: 22px; height: 22px; border-radius: 6px; background: #8FCDEF; color: #fff; display: grid; place-items: center; }
.app-note { margin: 6px 16px 10px; font-size: 9.5px; color: #8A94A3; line-height: 1.5; }
.app-note span { color: var(--cyan); }
.figcap { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--ink); padding-top: 8px; margin: 4px 24px 0 3%; color: var(--sub); }

/* ---------- features ---------- */
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 40px; border-top: 1px solid var(--hair); }
.cols3 article { padding: 22px 24px 6px 0; min-width: 0; }
.cols3 article + article { padding-left: 24px; border-left: 1px solid var(--hair); }
.cols3 .cap { color: var(--teal); }
.cols3 h3 { font-size: 21px; font-weight: 700; font-weight: 600; margin-top: 8px; }
.cols3 p { margin-top: 12px; font-size: 16.5px; color: var(--sub); line-height: 1.9; }
.cols3 .ex { margin-top: 16px; font-size: 16px; font-weight: 600; color: var(--blue); border-top: 1px dashed var(--hair); padding-top: 10px; }
.conn { display: flex; flex-wrap: wrap; margin-top: 28px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.conn span { font-size: 16px; font-weight: 600; color: var(--ink); padding: 10px 18px 10px 0; margin-right: 18px; border-right: 1px solid var(--hair); }
.conn span:last-child { border-right: 0; }
.conn .cap { color: var(--sub); align-self: center; }

/* ---------- navy band ---------- */
.navyband { background: var(--band); color: #D5E0EB; }
.navyband .shead { border-color: #fff; color: #fff; }
.navyband .shead .r { color: #9FB4C9; }
.story { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; margin-top: 30px; }
.quote { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; color: #fff; line-height: 1.75; }
.story .body { margin-top: 20px; color: #CFDBE7; font-size: 17px; }
.story dl { margin: 0; border-top: 1px solid #34506D; }
.story dl div { padding-block: 14px; border-bottom: 1px solid #34506D; }
.story dt { font-weight: 700; color: #fff; font-size: 18px; }
.story dd { margin: 4px 0 0; font-size: 16px; color: #B9C9DA; }

/* ---------- rollout journey: one winding path through alternating steps ---------- */
.journey { position: relative; margin-top: 24px; }
.jsvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.jsvg path { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linecap: round; }
.jsvg circle { fill: var(--navy); }
.jrow { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr); gap: 28px; align-items: center; padding-block: 30px; }
.jrow.l { grid-template-areas: "txt mark vis"; }
.jrow.r { grid-template-areas: "vis mark txt"; }
.jtxt { grid-area: txt; min-width: 0; }
.jrow.l .jtxt { text-align: right; }
.jtxt .cap { color: var(--teal); }
.jtxt h3 { font-size: 23px; font-weight: 700; margin-top: 6px; }
.jtxt p { margin-top: 10px; color: var(--sub); font-size: 16.5px; line-height: 1.9; max-width: 22em; }
.jrow.l .jtxt p { margin-left: auto; }
.jmark { grid-area: mark; justify-self: center; position: relative; z-index: 1; width: 96px; height: 96px; border-radius: 50%; background: var(--paper); border: 1px solid var(--hair); box-shadow: 0 10px 24px -14px rgba(1, 41, 74, .45); display: grid; place-content: center; text-align: center; color: var(--ink); line-height: 1.1; }
.jmark .cap { font-size: 11px; color: var(--sub); }
.jmark b { font-size: 34px; font-weight: 700; }
.jvis { grid-area: vis; min-width: 0; position: relative; }
.jvis::before { content: ""; position: absolute; inset: -26px -30px; background: radial-gradient(closest-side, rgba(0, 156, 220, .10), transparent); }
.jrow.r .jvis { justify-self: end; }
.vcard { position: relative; background: #fff; border: 1px solid #DDE3EA; box-shadow: 0 14px 30px -20px rgba(1, 41, 74, .45); padding: 16px 18px; font-size: 15px; max-width: 360px; }
.vq { font-weight: 600; color: var(--ink); padding-bottom: 8px; border-bottom: 1px solid #ECEEF2; }
.va { margin-top: 8px; padding: 6px 10px; background: #F2F6FA; }
.vhead { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; color: var(--ink); }
.vhead .cap { color: var(--sub); font-size: 11.5px; }
.vbar { height: 5px; background: #E6EBF1; margin-top: 8px; }
.vbar i { display: block; height: 100%; background: var(--navy); }
.vlist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.vlist li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid #ECEEF2; }
.vlist.ppl li { justify-content: space-between; }
.vlist em { font-style: normal; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sub); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); display: inline-block; flex: none; }

/* ---------- index list (also from Terakoya) ---------- */
.idx { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.idx li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 24px; align-items: baseline; padding-block: 22px; border-bottom: 1px solid var(--hair); }
.idx .cap { color: var(--sub); }
.idx b { font-weight: 700; color: var(--ink); font-size: 19px; display: block; }
.idx .d { display: block; font-size: 16px; color: var(--sub); margin-top: 4px; }
.idx .go { font-size: 15.5px; font-weight: 600; color: var(--blue); white-space: nowrap; text-decoration: none; }
.idx .go:hover { text-decoration: underline; }
.idx .go + .go { margin-left: 14px; }

/* ---------- photo slot (until photos are cleared for the web) ---------- */
.photo { position: relative; aspect-ratio: 3 / 2; background: repeating-linear-gradient(135deg, #EEF2F6 0 10px, #E6EBF1 10px 20px); border: 1px dashed #B9C4D1; display: grid; place-content: center; text-align: center; color: var(--sub); font-size: 13px; padding: 16px; max-width: 100%; }
.photo .cap { color: var(--sub); }

.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; margin-top: 32px; align-items: start; }
.about p + p { margin-top: 14px; }
.about .who { margin-top: 20px; display: flex; align-items: center; gap: 14px; color: var(--ink); font-weight: 600; }
.about .who img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.about .who small { display: block; font-weight: 400; color: var(--sub); font-size: 14.5px; }
.pic { margin: 0; min-width: 0; }
.pic img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.pic .figcap { margin: 8px 0 0; }

/* ---------- CTA and footer ---------- */
.cta { background: var(--paper); border-top: 2px solid var(--ink); }
.cta .in { display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; padding-block: 64px; }
.cta h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 700; }
.cta p { color: var(--sub); margin-top: 8px; font-size: 17px; }
.site-foot { background: var(--paper); border-top: 1px solid var(--ink); color: var(--sub); }
.site-foot .in { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
.site-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .story, .about, .hero-sub { grid-template-columns: minmax(0, 1fr); }
  .hero-sub { gap: 28px; }
  .figcap { margin-left: 0; margin-right: 0; }
  .cols3 { grid-template-columns: minmax(0, 1fr); }
  .cols3 article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
  .idx li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mast .mid { display: none; }
}
@media (min-width: 901px) { .app { zoom: 1.22; } }
@media (max-width: 560px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app-side { display: none; }
}
@media (max-width: 760px) {
  .menu-btn { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid var(--hair); padding: 8px max(24px, env(safe-area-inset-left, 0px)) 16px; }
  .nav.open { display: flex; }
  .nav li a { display: block; padding-block: 10px; }
  .part { padding-block: 56px; }
  .jrow, .jrow.l, .jrow.r { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "mark txt" "mark vis"; gap: 14px 18px; padding-block: 22px; }
  .jrow.l .jtxt { text-align: left; }
  .jrow.l .jtxt p { margin-left: 0; }
  .jrow.r .jvis { justify-self: start; }
  .jmark { width: 64px; height: 64px; align-self: start; }
  .jmark b { font-size: 20px; }
  .jvis::before { display: none; }
}

/* ---------- inner pages (about, contact, courses) ---------- */
.page-hero { background: var(--paper); border-bottom: 1px solid var(--hair); }
.page-hero .in { padding-block: 72px 64px; }
.page-hero .kick { color: var(--teal); }
.page-hero h1 { font-size: clamp(32px, 5vw, 60px); font-weight: 700; line-height: 1.3; margin-top: 18px; }
.page-hero .lead { margin-top: 24px; font-size: clamp(17px, 1.6vw, 20px); max-width: 34em; }
/* App Store screenshots on the app page. */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; max-width: 900px; }
.shots img { width: 100%; height: auto; border-radius: 18px; display: block; }
@media (max-width: 640px) { .shots { grid-template-columns: repeat(3, 72%); overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; } .shots img { scroll-snap-align: start; } }
.values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 40px; border-top: 2px solid var(--ink); }
.values div { padding: 16px 20px 4px 0; }
.values div + div { padding-left: 20px; border-left: 1px solid var(--hair); }
.values .cap { color: var(--teal); display: block; }
.values b { display: block; font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 4px; }

.msg { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 56px; margin-top: 36px; align-items: start; }
.msg aside { position: sticky; top: 96px; }
.msg aside img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.msg aside .nm { margin-top: 14px; font-size: 20px; font-weight: 700; color: var(--ink); }
.msg aside .ti { color: var(--sub); font-size: 15px; }
.msg aside .tlink { display: inline-block; margin-top: 12px; font-size: 15px; }
.msg article { max-width: 38em; }
.msg article p + p { margin-top: 20px; }
.msg .sign { margin-top: 28px; text-align: right; color: var(--ink); font-weight: 700; }
.msg .notes { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--hair); font-size: 15px; color: var(--sub); }
.msg .notes p + p { margin-top: 6px; }

.rows { margin: 36px 0 0; border-top: 1px solid var(--ink); }
.rows div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding-block: 20px; border-bottom: 1px solid var(--hair); }
.rows dt { font-weight: 700; color: var(--ink); }
.rows dd { margin: 0; }

.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 40px; }
.team article { border-top: 2px solid var(--ink); padding-top: 24px; }
.team img { width: 128px; height: 128px; border-radius: 50%; object-fit: cover; }
.team h3 { font-size: 21px; font-weight: 700; margin-top: 18px; }
.team .ti { color: var(--teal); font-weight: 600; font-size: 15px; }
.team p { margin-top: 10px; font-size: 16px; color: var(--sub); }

@media (max-width: 900px) {
  .msg, .team { grid-template-columns: minmax(0, 1fr); }
  .msg aside { position: static; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 20px; align-items: end; }
  .msg aside img { grid-row: span 3; }
  .values { grid-template-columns: minmax(0, 1fr); }
  .values div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
  .rows div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
/* Avoid a second heavy rule right under a section head. */
.shead + .rows { margin-top: 12px; border-top: 0; }
.team article { border-top: 0; padding-top: 0; }

/* ---------- legal text (privacy, terms) ---------- */
.legal { max-width: 46em; }
.legal > p:first-child { font-size: 18px; color: var(--ink); }
.legal h2 { font-size: 21px; font-weight: 700; margin-top: 44px; padding-top: 14px; border-top: 1px solid var(--hair); }
.legal h3 { font-size: 18px; font-weight: 700; margin-top: 24px; }
.legal p, .legal ol, .legal ul { margin-top: 14px; }
.legal ol, .legal ul { padding-left: 1.6em; }
.legal li + li { margin-top: 6px; }
.legal li > ol, .legal li > ul { margin-top: 6px; }

/* ---------- contact ---------- */
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 36px; border-top: 2px solid var(--ink); }
.ways article { padding: 24px 24px 8px 0; }
.ways article + article { padding-left: 24px; border-left: 1px solid var(--hair); }
.ways .cap { color: var(--teal); }
.ways h3 { font-size: 22px; font-weight: 700; margin-top: 8px; }
.ways p { margin-top: 10px; color: var(--sub); font-size: 16.5px; }
.ways .btn { margin-top: 20px; }
.mailbox { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.mailbox .addr { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--ink); }
.mailbox .addr:hover { color: var(--blue); border-color: var(--blue); }
.mailbox ol { margin: 14px 0 0; padding-left: 1.4em; }
.mailbox li + li { margin-top: 6px; }
.tpl { background: var(--paper); border: 1px solid var(--hair); padding: 20px 24px; font-size: 16px; }
.tpl .cap { color: var(--sub); }
.tpl dl { margin: 10px 0 0; }
.tpl dt { font-weight: 700; color: var(--ink); margin-top: 8px; }
.tpl dd { margin: 0; color: var(--sub); }
/* Contact form */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; margin-top: 24px; align-items: start; }
.contact .mailbox { margin-top: 0; display: block; position: sticky; top: 96px; }
.contact .mailbox .addr { font-size: 24px; }
.cform { display: grid; gap: 22px; max-width: 680px; }
.cform .lbl { display: block; font-weight: 700; color: var(--ink); font-size: 16px; }
.cform .req { font-size: 12px; font-weight: 700; color: var(--teal); margin-left: 6px; letter-spacing: .04em; }
.cform .hint { display: block; color: var(--sub); font-size: 14px; margin-top: 2px; }
.cform input[type=text], .cform input[type=email], .cform select, .cform textarea { display: block; width: 100%; margin-top: 8px; font: inherit; font-size: 16px; color: var(--txt); background: var(--paper); border: 1px solid var(--hair); border-radius: 8px; padding: 12px 14px; }
.cform textarea { resize: vertical; min-height: 140px; }
.cform input:focus, .cform select:focus, .cform textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.cform .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.cform .kinds { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cform .kinds legend { margin-bottom: 10px; padding: 0; }
.cform .kinds label { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--hair); border-radius: 10px; padding: 16px; cursor: pointer; background: var(--paper); color: var(--sub); font-size: 14.5px; }
.cform .kinds label:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.cform .kinds b { display: block; color: var(--ink); font-size: 16.5px; margin-bottom: 4px; }
.cform .kinds input, .cform .consent input { margin-top: 4px; accent-color: var(--blue); width: 18px; height: 18px; flex: none; }
.cform .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; }
.cform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cform [data-demo][hidden] { display: none; }
.cform .send { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.cform .send .btn[disabled] { opacity: .6; cursor: wait; }
.cform .status { margin: 0; font-size: 15.5px; color: var(--sub); }
.cform .status.ok { color: var(--teal); font-weight: 700; }
.cform .status.err { color: #C2410C; font-weight: 700; }
@media (max-width: 900px) {
  .contact { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .contact .mailbox { position: static; }
}
@media (max-width: 640px) {
  .cform .two, .cform .kinds { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- courses ---------- */
.course-pic { margin: 40px 0 0; }
.course-pic img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.course-pic .figcap { margin: 8px 0 0; }
@media (max-width: 900px) {
  .ways, .mailbox { grid-template-columns: minmax(0, 1fr); }
  .ways article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
  .course-pic img { aspect-ratio: 3 / 2; }
}
.shead + .ways { margin-top: 12px; border-top: 0; }
.legal h2 { max-width: none; }

/* ===================== top page v2 (after the 2026-11-05 sales deck) ===================== */
/* Hero: navy text panel beside a full-bleed photo. */
.hero2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--band); color: #fff; }
.hero2 .txt { padding: 88px 56px 72px max(24px, calc((100vw - var(--max)) / 2 + 24px)); }
.hero2 .kick { color: #7FD8D5; }
.hero2 h1 { color: #fff; font-size: clamp(40px, 5.4vw, 76px); font-weight: 700; line-height: 1.22; margin-top: 18px; }
.hero2 .sub { margin-top: 26px; font-size: clamp(20px, 2vw, 26px); font-weight: 700; color: #3CC8C3; }
.hero2 .lead { margin-top: 18px; font-size: clamp(17px, 1.5vw, 19px); color: #DCE6F0; max-width: 30em; }
.hero2 .ctas { margin-top: 34px; }
.hero2 .tlink { color: #fff; border-color: #fff; }
.hero2 .facts { border-color: #34506D; }
.hero2 .facts .cap { color: #9FB4C9; }
.hero2 .facts b { color: #fff; }
.hero2 .pic2 { margin: 0; min-height: 100%; position: relative; }
.hero2 .pic2 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* App window: notes panel on the right, as in the real app. */
.app.wide { grid-template-columns: 150px minmax(0, 1fr) 230px; }
.app-notes { border-left: 1px solid var(--grey); padding: 12px 14px; font-size: 11.5px; background: #fff; }
.app-notes .hd { display: flex; justify-content: space-between; color: #8A94A3; padding-bottom: 10px; border-bottom: 1px solid var(--grey); }
.app-notes .lbl { margin-top: 10px; color: #8A94A3; font-size: 10.5px; }
.app-notes ol { list-style: none; margin: 4px 0 0; padding: 0; }
.app-notes li { display: flex; gap: 6px; align-items: center; padding: 3px 0; color: #1F2733; }
.app-notes li i { font-style: normal; color: #8A94A3; width: 10px; }
.app .a sup { color: var(--cyan); font-size: 9.5px; margin-left: 1px; }
.app .a .warn { font-weight: 600; margin-top: 6px; }
.app-saved { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--grey); border-radius: 8px; padding: 2px 8px; font-size: 10.5px; color: var(--sub); }
.app-saved .dot { width: 6px; height: 6px; }
.app-saved u { text-decoration: none; border: 1px solid var(--grey); border-radius: 4px; padding: 0 4px; color: #1F2733; }

/* Four numbered steps under the app window. */
.steps4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 48px; border-top: 2px solid var(--teal); }
.steps4 div { padding: 22px 22px 6px 0; }
.steps4 div + div { padding-left: 22px; border-left: 1px solid var(--hair); }
.steps4 b { display: flex; align-items: center; gap: 10px; font-size: 22px; color: var(--ink); }
.steps4 b i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 15px; display: grid; place-items: center; flex: none; }
.steps4 p { margin-top: 10px; color: var(--sub); font-size: 16.5px; }
.stage-white { background: var(--paper); padding-block: 0 88px; }
.stage-white .stage { background: linear-gradient(var(--band) 0 30%, var(--paper) 30%); }

/* Organisation brain: hierarchy versus shared hub. */
.brain2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; margin-top: 40px; }
.brain2 figure { margin: 0; }
.brain2 figcaption { font-weight: 700; color: var(--sub); font-size: 15px; }
.brain2 .hub figcaption { color: var(--blue); }
.brain2 svg { width: 100%; height: auto; margin-top: 12px; }
.brain2 .hub svg { background: #F2F7FB; border: 1px dashed #A9C6DE; border-radius: 16px; }
.brain2 .note { margin-top: 12px; color: var(--sub); font-size: 16px; }
.keep2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; margin-top: 56px; align-items: center; }
.keep2 h3 { font-size: 24px; font-weight: 700; color: var(--blue); }
.keep2 .rows { margin-top: 18px; }
.keep2 .rows div { grid-template-columns: 140px minmax(0, 1fr); }
.keep2 img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* Learning loop over a darkened city photo. */
.loop { position: relative; color: #fff; background: var(--band) center / cover no-repeat; }
.loop::before { content: ""; position: absolute; inset: 0; background: rgba(1, 41, 74, .86); }
.loop .in { position: relative; }
.loop .shead { border-color: #fff; color: #fff; }
.loop .shead .r { color: #9FB4C9; }
.loop h2 { color: #fff; }
.loop4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin-top: 48px; }
.loop4 div { border-top: 5px solid var(--cyan); padding-top: 18px; }
.loop4 div:last-child { border-color: var(--teal); }
.loop4 .n { color: #3CC8C3; font-weight: 700; font-size: 15px; }
.loop4 b { display: block; font-size: 30px; margin-top: 6px; }
.loop4 p { margin-top: 8px; color: #CFDBE7; font-size: 16.5px; }
.loop .close { margin-top: 48px; padding-top: 18px; border-top: 1px solid #3CC8C3; text-align: center; font-size: 19px; font-weight: 600; }

/* Eight tasks we ran ourselves. */
.tasks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 28px; margin-top: 40px; }
.tasks div { border-top: 3px solid var(--teal); padding-top: 14px; }
.tasks div:nth-child(n+5) { border-color: var(--blue); }
.tasks .k { font-size: 13px; font-weight: 700; color: var(--sub); }
.tasks .k em { font-style: normal; color: var(--teal); margin-right: 6px; }
.tasks b { display: block; font-size: 21px; color: var(--ink); margin-top: 6px; }
.tasks .t { font-size: 14.5px; font-weight: 600; color: var(--blue); margin-top: 2px; }
.callout { margin-top: 40px; background: #E3F1FA; padding: 16px 22px; font-weight: 700; color: var(--ink); font-size: 17px; }

/* Data handling: three columns. */
.data3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 40px; }
.data3 div { border-top: 3px solid var(--blue); padding-top: 16px; }
.data3 div:first-child { border-color: var(--teal); }
.data3 h3 { font-size: 21px; font-weight: 700; color: var(--blue); }
.data3 p { margin-top: 10px; color: var(--sub); font-size: 16.5px; }

/* Price. */
.price { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 48px; margin-top: 40px; align-items: start; }
.price .box { background: var(--band); color: #fff; padding: 36px 36px 32px; }
.price .box .cap { color: #9FB4C9; }
.price .box .big { font-size: clamp(48px, 6vw, 72px); font-weight: 700; line-height: 1.1; margin-top: 10px; }
.price .box .per { font-weight: 700; font-size: 18px; margin-top: 6px; }
.price .box .mo { color: #3CC8C3; font-weight: 700; font-size: 22px; margin-top: 14px; }
.price .box ul { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid #34506D; color: #CFDBE7; font-size: 15.5px; }
.price .box ul li:last-child { color: #fff; font-weight: 700; }
.price .pts div { border-top: 3px solid var(--blue); padding-block: 14px 16px; }
.price .pts div:first-child { border-color: var(--teal); }
.price .pts h3 { font-size: 20px; font-weight: 700; color: var(--blue); }
.price .pts p { margin-top: 6px; color: var(--sub); font-size: 16px; }
.fine { margin-top: 14px; font-size: 13.5px; color: var(--sub); }

/* Team row. */
.team.big img { width: 168px; height: 168px; }

@media (max-width: 900px) {
  .hero2, .brain2, .keep2, .price { grid-template-columns: minmax(0, 1fr); }
  .hero2 .txt { padding: 64px 24px 56px; }
  .hero2 .pic2 { min-height: 0; aspect-ratio: 16 / 10; order: -1; }
  .steps4, .loop4, .tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .steps4 div, .steps4 div + div { padding: 18px 0 0; border-left: 0; }
  .data3 { grid-template-columns: minmax(0, 1fr); }
  .app.wide { grid-template-columns: 150px minmax(0, 1fr); }
  .app-notes { display: none; }
}
@media (max-width: 560px) {
  .app.wide { grid-template-columns: minmax(0, 1fr); }
  .steps4, .loop4, .tasks { grid-template-columns: minmax(0, 1fr); }
  .keep2 .rows div { grid-template-columns: minmax(0, 1fr); }
}
/* Hero without a photo: text spans the navy band. */
.hero2:not(:has(.pic2)) { grid-template-columns: minmax(0, 1fr); }
.hero2:not(:has(.pic2)) .txt { padding-right: max(24px, calc((100vw - var(--max)) / 2 + 24px)); }
.hero2:not(:has(.pic2)) .lead { max-width: 36em; }
/* Hero with the app window on the right (no sidebar, notes panel kept). */
.hero2:has(.hero-shot) { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; }
.hero2:has(.hero-shot) .txt { padding-right: 24px; }
.hero2:has(.hero-shot) h1 { font-size: clamp(38px, 4.4vw, 64px); }
.hero-shot { margin: 0; padding: 72px max(24px, calc((100vw - var(--max)) / 2 + 24px)) 64px 16px; min-width: 0; }
.hero-shot .app.wide { grid-template-columns: minmax(0, 1fr) 210px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6); border-color: transparent; }
.hero-shot .app-side { display: none; }
.hero-shot .figcap { border-color: #5C7896; color: #9FB4C9; margin: 14px 0 0; }
@media (min-width: 901px) { .hero-shot .app { zoom: 1; } }
@media (max-width: 900px) {
  .hero2:has(.hero-shot) { grid-template-columns: minmax(0, 1fr); }
  .hero-shot { padding: 0 24px 56px; }
  .hero-shot .app.wide { grid-template-columns: minmax(0, 1fr); }
}

/* ===================== top page v3: web-style flow ===================== */
.kick2 { color: var(--teal); display: block; }
/* Steps strip right under the hero. */
.flow { background: var(--paper); border-bottom: 1px solid var(--hair); }
.flow4 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flow4 li { padding: 28px 24px 26px 0; position: relative; }
.flow4 li + li { padding-left: 24px; border-left: 1px solid var(--hair); }
.flow4 b { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--ink); }
.flow4 b i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 14px; display: grid; place-items: center; flex: none; }
.flow4 p { margin-top: 8px; color: var(--sub); font-size: 15.5px; line-height: 1.8; }
/* Editorial text beside one diagram. */
.story2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.prose h2 { margin-top: 12px; }
.prose p { margin-top: 18px; }
.loopline { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; counter-reset: lp; }
.loopline li { counter-increment: lp; background: var(--paper); border: 1px solid var(--hair); padding: 8px 14px; font-size: 14.5px; color: var(--sub); }
.loopline li b { display: block; color: var(--ink); font-size: 17px; }
.loopline li b::before { content: counter(lp) ". "; color: var(--teal); }
.aside { font-weight: 700; color: var(--ink); }
.hubfig { margin: 0; }
.hubfig svg { width: 100%; height: auto; }
.hubfig figcaption { margin-top: 10px; text-align: center; color: var(--sub); font-size: 14.5px; }
/* Horizontal rail of cards. */
.rowhead { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.rowhead h2 { margin-top: 0; }
.rowhead p { color: var(--sub); max-width: 30em; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 36px; padding: 4px max(24px, calc((100vw - var(--max)) / 2 + 24px)) 18px; scrollbar-width: thin; }
.rail article { scroll-snap-align: start; background: var(--page); border-top: 3px solid var(--teal); padding: 20px 22px 24px; }
.rail .k { font-size: 13px; font-weight: 700; color: var(--teal); }
.rail b { display: block; font-size: 21px; color: var(--ink); margin-top: 8px; }
.rail p { margin-top: 8px; font-size: 15.5px; color: var(--sub); line-height: 1.8; }
/* FAQ accordion. */
.faqwrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 56px; align-items: start; }
.faqwrap h2 { margin-top: 12px; }
.faq details { border-top: 1px solid var(--hair); }
.faq details:last-child { border-bottom: 1px solid var(--hair); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative; font-size: 18px; font-weight: 700; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 16px; font-size: 26px; font-weight: 400; color: var(--blue); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 40px 22px 0; color: var(--sub); }
.faq summary:hover { color: var(--blue); }
@media (max-width: 900px) {
  .flow4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow4 li, .flow4 li + li { padding: 20px 16px 16px 0; border-left: 0; }
  .story2, .faqwrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
.rail { scroll-padding-inline: max(24px, calc((100vw - var(--max)) / 2 + 24px)); }
.loopline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.loopline li { padding: 8px 10px; font-size: 13.5px; }
@media (max-width: 560px) { .loopline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Our own work: a two-column ruled list, everything visible at once. */
.worklist { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; border-top: 2px solid var(--ink); }
.worklist li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 12px; padding-block: 20px; border-bottom: 1px solid var(--hair); }
.worklist .n { font-size: 26px; font-weight: 700; color: var(--teal); line-height: 1.2; }
.worklist .k { font-size: 13px; font-weight: 700; color: var(--sub); }
.worklist b { display: block; font-size: 20px; color: var(--ink); margin-top: 2px; }
.worklist p { margin-top: 4px; font-size: 15.5px; color: var(--sub); line-height: 1.8; }
@media (max-width: 760px) { .worklist { grid-template-columns: minmax(0, 1fr); } }
/* Work map diagram; the ruled list takes over on small screens. */
.mapfig { margin: 40px 0 0; }
.wmap { width: 100%; height: auto; }
.worklist.mobile-only { display: none; }
@media (max-width: 760px) {
  .mapfig { display: none; }
  .worklist.mobile-only { display: grid; }
}

/* ===================== top page v4: product-first, centred hero ===================== */
.navcta { margin-left: 6px; }
.navcta .btn { font-size: 13.5px; padding: 10px 18px; letter-spacing: .04em; color: #fff; box-shadow: none; }
.nav .navcta a[aria-current] { box-shadow: none; }
.btn-soft { background: #E3F1FA; color: var(--blue); }
.btn-soft:hover { background: #D2E8F6; }
.hero3 { background: var(--paper); text-align: center; overflow: hidden; }
.hero3 > .in:first-child { padding-block: 88px 0; }
.hero3 h1 { font-size: clamp(40px, 6.6vw, 92px); font-weight: 700; line-height: 1.18; letter-spacing: -.01em; color: var(--ink); }
.hero3 .pill { display: inline-flex; align-items: center; gap: .18em; background: #FDE9C8; border-radius: .5em; padding: 0 .28em 0 .22em; margin: 0 .06em; }
.hero3 .pill i { width: .32em; height: .32em; border-radius: 50%; background: var(--gold); display: inline-block; }
.hero3 .lead { margin: 28px auto 0; max-width: 34em; font-size: clamp(17px, 1.6vw, 20px); color: var(--txt); }
.hero3 .ctas { justify-content: center; margin-top: 34px; gap: 14px; }
.hero3 .meta { margin-top: 22px; font-size: 14px; color: var(--sub); }
.hero3-shot { margin-top: 56px; }
.hero3-shot .shot { max-width: 1080px; margin: 0 auto; text-align: left; }
.hero3-shot .app { box-shadow: 0 50px 100px -40px rgba(1, 41, 74, .45); }
@media (min-width: 901px) { .hero3-shot .app { zoom: 1.12; } }
.hero3-shot .figcap { margin: 14px 0 0; }
.hero3 + .flow { border-top: 0; }
.priceband { background: var(--band); color: #fff; }
.priceband .in { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 40px; }
.priceband p { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.priceband .cap { color: #9FB4C9; }
.priceband b { font-size: clamp(24px, 3vw, 34px); }
.priceband p > span:last-child { color: #CFDBE7; font-size: 15.5px; }
.priceband .tlink { color: #fff; border-color: #fff; }
@media (max-width: 1080px) { .navcta { display: none; } }
@media (max-width: 760px) { .navcta { display: block; margin: 8px 0 0; } .navcta .btn { display: inline-flex; } }

/* ===================== top page v5: Terakoya's own editorial hero ===================== */
.hero4 { background: linear-gradient(var(--paper) 0 62%, var(--band) 62%); padding-block: 48px 72px; }
.hero4-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: end; margin-top: 28px; }
.hero4 h1 { font-size: clamp(40px, 5.8vw, 80px); font-weight: 700; line-height: 1.2; color: var(--ink); }
.hero4 .lead { font-size: clamp(17px, 1.5vw, 19px); color: var(--txt); }
.hero4 .ctas { margin-top: 26px; }
.hero4-shot { margin: 48px auto 0; max-width: none; }
.hero4-shot .app { box-shadow: 0 50px 100px -40px rgba(1, 41, 74, .5); }
@media (min-width: 901px) { .hero4-shot .app { zoom: 1.12; } }
.hero4-shot .figcap { margin: 14px 0 0; border-color: #5C7896; color: #9FB4C9; }
.hero4 + .flow { border-top: 0; }
@media (max-width: 900px) {
  .hero4 { background: linear-gradient(var(--paper) 0 70%, var(--band) 70%); }
  .hero4-top { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* Hero demo: the real Terakoya UI (captured, example data) animated inside a scaled iframe. */
.demo { background: #fff; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; box-shadow: 0 50px 100px -40px rgba(1, 41, 74, .5); }
.demo-bar { display: flex; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--grey); }
.demo-bar i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.demo-bar i + i { background: #FEBC2E; }
.demo-bar i + i + i { background: #28C840; }
.demo-view { position: relative; aspect-ratio: 1344 / 860; overflow: hidden; }
.demo-view iframe { position: absolute; top: 0; left: 0; width: 1344px; height: 860px; border: 0; transform-origin: 0 0; transform: scale(var(--s, .8)); pointer-events: none; }
.demo-pause { font: inherit; letter-spacing: inherit; text-transform: inherit; background: none; border: 1px solid currentColor; border-radius: 999px; padding: 1px 10px; margin-left: 10px; color: inherit; cursor: pointer; }
@media (max-width: 760px) {
  .demo-view { aspect-ratio: 520 / 760; }
  .demo-view iframe { width: 520px; height: 760px; }
}
/* Callouts outside the demo window, pointing at what just happened inside it. */
.hero4 { overflow-x: clip; }
.hero4-shot .demo { position: relative; overflow: visible; max-width: 1000px; margin: 0 auto; }
.hero4-shot .demo-bar { border-radius: 12px 12px 0 0; }
.hero4-shot .demo-view { border-radius: 0 0 12px 12px; }
.pin { position: absolute; z-index: 3; display: flex; align-items: center; pointer-events: none; opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease; }
.pin.show { opacity: 1; transform: none; }
.pin span { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); font-size: 14.5px; font-weight: 700; line-height: 1.5; padding: 9px 14px; border-radius: 10px; box-shadow: 0 14px 30px -12px rgba(1, 41, 74, .45); white-space: nowrap; }
.pin[data-side="right"] span { white-space: normal; flex: none; width: 150px; }
.pin i { display: block; height: 2px; background: var(--gold); position: relative; flex: none; }
.pin i::after { content: ""; position: absolute; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px #fff; }
.pin[data-side="left"] i::after { right: -5px; }
.pin[data-side="right"] { flex-direction: row-reverse; }
.pin[data-side="right"] i::after { left: -5px; }
@media (max-width: 1079px) { .pin { display: none; } }
/* Graph and calendar windows side by side. */
.views2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 40px; }
.views2 figure { margin: 0; min-width: 0; }
.views2 .demo { box-shadow: 0 30px 60px -30px rgba(1, 41, 74, .4); }
.demo-view.v { aspect-ratio: 1088 / 760; }
.demo-view.v iframe { width: 1088px; height: 760px; }
.views2 figcaption { margin-top: 16px; color: var(--sub); }
.views2 figcaption b { display: block; color: var(--ink); font-size: 19px; }
@media (max-width: 900px) { .views2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .demo-view.v { aspect-ratio: 1088 / 760; } .demo-view.v iframe { width: 1088px; height: 760px; } }
/* Hero tour: stacked screens, a pointer, and callouts that draw in after the app's output. */
.demo-view.tour iframe { opacity: 0; transition: opacity .45s ease; }
.demo-view.tour iframe.on { opacity: 1; }
.cursor { position: absolute; z-index: 4; width: 22px; height: 22px; margin: -4px 0 0 -4px; opacity: 0; pointer-events: none; transition: left .7s cubic-bezier(.4, 0, .2, 1), top .7s cubic-bezier(.4, 0, .2, 1), opacity .2s; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-6.5 1.2L16 21l-3 1.4-3.4-6.9L4 20z' fill='%2301294A' stroke='%23fff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E"); left: 60%; top: 70%; }
.cursor.on { opacity: 1; }
.cursor::after { content: ""; position: absolute; left: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 156, 220, .35); transform: scale(0); transition: transform .2s; }
.cursor.click::after { transform: scale(1.4); }
.pin i { transform: scaleX(0); transition: transform .35s ease; }
.pin[data-side="left"] i { transform-origin: right center; }
.pin[data-side="right"] i { transform-origin: left center; }
.pin span { opacity: 0; transition: opacity .25s ease .3s; }
.pin.show i { transform: scaleX(1); }
.pin.show span { opacity: 1; }
.pin { transform: none; transition: opacity .2s ease; }
/* Camera: zoom into what matters, then pull back. */
.demo-view .cam { position: absolute; inset: 0; transform-origin: 0 0; transition: transform .9s cubic-bezier(.4, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) { .demo-view .cam { transition: none; } }
/* Finished tour: three floating screens in a staggered row, taking turns at the centre. */
.demo.final { background: transparent; border-color: transparent; box-shadow: none; }
.demo.final .demo-bar { visibility: hidden; }
.demo-view.tour.final { overflow: visible; }
.demo-view.tour.final iframe { border-radius: 14px; box-shadow: 0 40px 80px -24px rgba(1, 41, 74, .5); transition: transform .9s cubic-bezier(.4, 0, .2, 1), opacity .6s ease; }
.demo-view.tour iframe { transition: opacity .45s ease, transform .9s cubic-bezier(.4, 0, .2, 1); }
.hero4-shot:has(.demo.final) .figcap { margin-top: 64px; transition: margin-top .9s cubic-bezier(.4, 0, .2, 1); }
/* Final row: translucent arrows to move along the four screens. */
.demo-arrow { display: none; position: absolute; top: calc(50% + 20px); z-index: 6; width: 56px; height: 56px; margin-top: -28px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 10px 30px -10px rgba(1, 41, 74, .45); cursor: pointer; place-items: center; transition: background .2s, transform .2s; }
.demo-arrow svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.demo-arrow:hover { background: rgba(255, 255, 255, .85); transform: scale(1.06); }
.demo-arrow.prev { left: -8px; }
.demo-arrow.next { right: -8px; }
.demo.final .demo-arrow { display: grid; }
.demo.final { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.demo.final .demo-view { cursor: grab; }
.demo.final .demo-view:active { cursor: grabbing; }
/* The demo button keeps one width: all three labels share a cell, only the current one shows. */
.demo-pause { display: inline-grid; justify-items: center; }
.demo-pause span { grid-area: 1 / 1; visibility: hidden; }
.demo-pause[data-state="pause"] [data-for="pause"], .demo-pause[data-state="play"] [data-for="play"], .demo-pause[data-state="replay"] [data-for="replay"] { visibility: visible; }

/* Real work examples: tabs on the left, one case on the right. */
.cases { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; margin-top: 40px; align-items: start; }
.cases-tabs { display: flex; flex-direction: column; border-top: 2px solid var(--ink); position: sticky; top: 96px; }
.cases-tabs button { font: inherit; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--hair); padding: 16px 14px 16px 18px; cursor: pointer; color: var(--sub); position: relative; transition: background .2s, color .2s; }
.cases-tabs button .n { display: block; font-size: 12.5px; font-weight: 700; color: var(--teal); }
.cases-tabs button b { display: block; font-size: 18px; color: inherit; margin-top: 2px; }
.cases-tabs button:hover { background: #F3F7FB; color: var(--ink); }
.cases-tabs button[aria-selected="true"] { background: #EAF4FA; color: var(--ink); }
.cases-tabs button[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.case { animation: casein .4s ease both; }
@keyframes casein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.case h3 { font-size: clamp(21px, 2.2vw, 26px); font-weight: 700; color: var(--ink); }
.case-flow { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--hair); }
.case-flow li { padding: 14px 18px 4px 0; position: relative; }
.case-flow li + li { padding-left: 22px; border-left: 1px solid var(--hair); }
.case-flow li + li::before { content: "→"; position: absolute; left: -9px; top: 12px; background: var(--paper); color: var(--teal); font-weight: 700; }
.case-flow .cap { color: var(--teal); }
.case-flow p { margin-top: 6px; font-size: 15.5px; color: var(--txt); line-height: 1.8; }
.case figure { margin: 24px 0 0; }
.case figure img { width: 100%; border: 1px solid var(--hair); border-radius: 10px; box-shadow: 0 24px 50px -30px rgba(1, 41, 74, .45); }
.case figure figcaption { margin-top: 8px; font-size: 13.5px; color: var(--sub); }
.case-result { margin-top: 18px; padding: 14px 18px; background: #E3F1FA; color: var(--ink); font-size: 16px; }
.case-result b { margin-right: 4px; }
@media (max-width: 900px) {
  .cases { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cases-tabs { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
  .cases-tabs button { border-bottom: 1px solid var(--hair); padding: 12px 14px; }
  .cases-tabs button:nth-child(odd) { border-right: 1px solid var(--hair); }
  .cases-tabs button[aria-selected="true"]::before { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 3px; }
  .case-flow { grid-template-columns: minmax(0, 1fr); }
  .case-flow li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
  .case-flow li + li::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .case { animation: none; } }
/* Cases, stronger hierarchy: a white card, numbered step boxes, a navy result bar. */
.cases-panels { background: var(--paper); border: 1px solid var(--hair); border-radius: 14px; padding: 30px 32px 32px; box-shadow: 0 30px 60px -40px rgba(1, 41, 74, .45); }
.case h3 { font-size: clamp(22px, 2.4vw, 28px); }
.cases-tabs button { color: var(--txt); }
.cases-tabs button b { font-size: 19px; }
.case-flow { gap: 34px; border-top: 0; margin-top: 24px; }
.case-flow li, .case-flow li + li { padding: 18px 18px 20px; border-left: 0; background: #F2F6FA; border-radius: 10px; border-top: 5px solid var(--navy); }
.case-flow li.s-ai { border-top-color: var(--teal); background: #EAF7F6; }
.case-flow li + li::before { content: "→"; left: -28px; top: 50%; margin-top: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.case-flow .lbl { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; color: var(--ink); }
.case-flow .lbl i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; display: grid; place-items: center; flex: none; }
.case-flow .s-ai .lbl i { background: var(--teal); }
.case-flow p { margin-top: 10px; font-size: 16px; color: var(--ink); }
.case-result { margin-top: 20px; background: var(--band); color: #fff; font-size: 17px; font-weight: 600; padding: 16px 20px; border-radius: 10px; }
.case-result b { color: #7FD8D5; }
.case figure { margin-top: 26px; }
@media (max-width: 900px) {
  .cases-panels { padding: 22px 18px; }
  .case-flow { gap: 12px; }
  .case-flow li + li { border-top: 5px solid var(--navy); }
  .case-flow li.s-ai { border-top-color: var(--teal); }
}
/* Cases: ruled rows in the site's own editorial style. */
.case-rows { margin: 22px 0 0; border-top: 2px solid var(--ink); }
.case-rows div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding-block: 16px; border-bottom: 1px solid var(--hair); }
.case-rows dt { font-weight: 700; color: var(--ink); font-size: 15.5px; }
.case-rows dd { margin: 0; color: var(--ink); font-size: 16.5px; line-height: 1.85; }
.case-rows .r-ask dd { font-size: 19px; font-weight: 500; }
.case-rows .r-res dd { font-weight: 700; }
.case-rows .r-res { border-bottom: 2px solid var(--ink); }
@media (max-width: 760px) { .case-rows div { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* ---------- features page ---------- */
.feat-jump { display: flex; flex-wrap: wrap; gap: 0; margin-top: 40px; border-top: 2px solid var(--ink); }
.feat-jump a { flex: 1 1 200px; padding: 14px 16px 14px 0; font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair); }
.feat-jump a:hover { color: var(--blue); }
.feat-stage { margin-top: 36px; padding: 48px 6% 0; background: linear-gradient(var(--band) 0 70%, transparent 70%); border-radius: 16px; }
.feat .feat-shot { box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); }
.feat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 44px; }
.feat-tiles article { border-top: 2px solid var(--ink); padding: 16px 0 26px; }
.feat-tiles h3 { font-size: 19px; font-weight: 700; color: var(--ink); }
.feat-tiles p { margin-top: 8px; font-size: 16px; color: var(--sub); }
@media (max-width: 900px) { .feat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feat-tiles { grid-template-columns: minmax(0, 1fr); } .feat-stage { padding: 24px 4% 0; } }

/* ---------- header dropdowns ---------- */
.site-head .in { position: relative; }
.nav li.has-mega { display: flex; align-items: center; gap: 2px; }
.mega-btn { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--sub); display: grid; place-items: center; }
.mega-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.mega { position: absolute; left: 0; right: 0; top: 100%; padding-top: 8px; visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease, visibility 0s .18s; text-transform: none; letter-spacing: normal; z-index: 40; }
.has-mega:hover .mega, .has-mega:focus-within .mega, .has-mega.open .mega { visibility: visible; opacity: 1; transform: none; transition: opacity .18s ease, transform .18s ease; }
.has-mega:hover .mega-btn svg, .has-mega.open .mega-btn svg { transform: rotate(180deg); }
.mega-in { background: var(--paper); border: 1px solid var(--hair); border-top: 2px solid var(--ink); border-radius: 0 0 14px 14px; box-shadow: 0 30px 60px -30px rgba(1, 41, 74, .4); padding: 22px 24px 0; }
.mega-lbl { font-size: 12.5px; font-weight: 700; color: var(--sub); }
.mega-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.mega-card { display: block; text-decoration: none; padding: 18px 18px 20px; border: 1px solid var(--hair); border-radius: 12px; background: var(--page); color: var(--ink); transition: border-color .2s, background .2s; }
.mega-card:hover { border-color: var(--ink); background: #fff; }
.mega-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px; background: var(--band); }
.mega-ic svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mega-card:nth-child(2) .mega-ic { background: var(--teal); }
.mega-card:nth-child(3) .mega-ic { background: var(--blue); }
.mega-card b { display: block; margin-top: 14px; font-size: 19px; }
.mega-card span:last-child { display: block; margin-top: 4px; font-size: 14.5px; color: var(--sub); line-height: 1.7; }
.mega-foot { display: flex; gap: 28px; margin: 18px -24px 0; padding: 14px 24px; border-top: 1px solid var(--hair); background: #F7F9FB; border-radius: 0 0 14px 14px; }
.mega-foot a { font-size: 14.5px; font-weight: 700; color: var(--blue); text-decoration: none; }
.mega-foot a:hover { text-decoration: underline; }
.mega-sm { left: auto; right: 160px; width: 560px; }
.mega-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; padding-bottom: 22px; }
.mega-big a { display: block; font-size: 21px; font-weight: 700; color: var(--ink); text-decoration: none; padding: 5px 0; }
.mega-small a { display: block; font-size: 15px; color: var(--txt); text-decoration: none; padding: 6px 0; }
.mega-big a:hover, .mega-small a:hover { color: var(--blue); }
@media (max-width: 760px) {
  .mega, .mega-btn { display: none; }
}
.flow-more { padding: 4px 0 26px; }
.ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .ways { grid-template-columns: minmax(0, 1fr); } }

/* ---------- security page ---------- */
.dflow-fig { margin: 36px 0 0; }
.dflow { width: 100%; height: auto; max-width: 980px; display: block; font-family: var(--sans); }
.ai3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; margin-top: 36px; }
.ai3 div { border-top: 2px solid var(--ink); padding-top: 16px; }
.ai3 .cap { color: var(--teal); }
.ai3 h3 { font-size: 21px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.ai3 p { margin-top: 10px; font-size: 16px; color: var(--txt); }
.ai3 p.note { font-size: 14.5px; color: var(--sub); border-top: 1px solid var(--hair); padding-top: 10px; }
@media (max-width: 900px) { .ai3 { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.values p { margin-top: 6px; font-size: 15.5px; color: var(--sub); }
.site-head { border-bottom: 2px solid var(--ink); }
.nw { white-space: nowrap; }

/* Scroll reveal (site.js). Classes are removed once shown, so they never affect hover or layout later. */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); }
.rv.rv-fade { transform: none; }
.rv.rv-on { opacity: 1; transform: none; }
.jsvg circle { transition: opacity .3s ease; }

/* ---------- dark mode (follows the OS setting) ----------
   Tokens flip; navy bands (--band) stay dark. The app screens (.demo iframes, .app mock) stay light,
   like screenshots of the app; inline diagrams keep their own light cards. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0E1621;
    --paper: #151F2C;
    --txt: #D5DEE8;
    --sub: #A5B2C2;
    --hair: #2B394A;
    --grey: #2B394A;
    --ink: #E6EDF5;
    --navy: #4C6290;
    --blue: #7CC4F2;
    --cyan: #3BB8EA;
    --teal: #3CCBC5;
    --band: #0F2742;
  }
  .brand img { filter: brightness(0) invert(1); opacity: .92; }
  .brand span { color: var(--ink); }
  .skip:focus { background: var(--paper); }
  .btn-white { background: var(--paper); color: var(--ink); }
  .btn-white:hover { background: #1C2838; }
  .btn-soft { background: #14304A; color: var(--blue); }
  .btn-soft:hover { background: #193A58; }
  .callout, .case-result { background: #14304A; color: var(--ink); }
  .vcard { background: var(--paper); border-color: var(--hair); }
  .vq { border-bottom-color: var(--hair); }
  .va { background: #1B2736; }
  .vbar { background: #24313F; }
  .vlist li { border-color: var(--hair); }
  .photo { background: repeating-linear-gradient(135deg, #18222F 0 10px, #1C2836 10px 20px); border-color: #3A4A5D; }
  .brain2 .hub svg { background: #152230; border-color: #2F4A63; }
  .cases-tabs button:hover { background: #1A2533; }
  .cases-tabs button[aria-selected="true"] { background: #17324C; }
  .case-flow li, .case-flow li + li { background: #1A2533; }
  .case-flow li.s-ai { background: #12302F; }
  .pin span { background: var(--paper); }
  .pin i::after { box-shadow: 0 0 0 3px var(--paper); }
  .mega-card:hover { background: #1A2533; }
  .mega-foot { background: #111A25; }
  .hubfig svg ellipse { stroke: #3E5A7A; stroke-width: 1.5; }
  /* The drawn app window keeps the app's light colours. */
  .app { color-scheme: light; --paper: #FFFFFF; --hair: #D3DAE3; --grey: #E5E5E9; --ink: #01294A; --txt: #2B3A4C; --sub: #44546A; --navy: #3E4F6D; --blue: #015E9E; --cyan: #009CDC; --teal: #00AEA9; color: var(--txt); }
  .cform .status.err { color: #FDBA74; }
}
