/*
 * three-piece unified design system
 * Shared tokens and components used by the homepage, detail pages,
 * forms, legal pages and utility pages.
 */

:root {
  --tp-navy-1000: #000d1c;
  --tp-navy-950: #00152b;
  --tp-navy-900: #08243f;
  --tp-navy-800: #103858;
  --tp-blue-700: #124f85;
  --tp-blue-600: #1c619e;
  --tp-blue-500: #3479b5;
  --tp-blue-100: #dce8f2;
  --tp-blue-50: #f2f5f7;
  --tp-gold-600: #927039;
  --tp-gold-500: #b18a49;
  --tp-gold-100: #e7dcc8;
  --tp-paper: #f4f1eb;
  --tp-surface: #ffffff;
  --tp-ink: #0a2038;
  --tp-muted: #526478;
  --tp-line: #d7e0e8;
  --tp-line-strong: #b8c5d1;
  --tp-error: #a1261f;
  --tp-shell: min(1200px, calc(100vw - 48px));
  --tp-measure: 42rem;
  --tp-radius-xs: 2px;
  --tp-radius-sm: 4px;
  --tp-radius-md: 8px;
  --tp-shadow-sm: 0 16px 38px rgb(0 18 38 / 7%);
  --tp-shadow-md: 0 30px 72px rgb(0 18 38 / 10%);
  --tp-shadow-lg: 0 46px 110px rgb(0 18 38 / 15%);
  --tp-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tp-section-space: clamp(5rem, 9vw, 8.5rem);

  /* Compatibility aliases for existing page CSS. */
  --navy-950: var(--tp-navy-950);
  --navy-900: var(--tp-navy-900);
  --navy-800: var(--tp-navy-800);
  --blue-700: var(--tp-blue-700);
  --blue-600: var(--tp-blue-600);
  --blue-500: var(--tp-blue-500);
  --blue-100: var(--tp-blue-100);
  --blue-50: var(--tp-blue-50);
  --gold: var(--tp-gold-500);
  --gold-soft: var(--tp-gold-100);
  --ink: var(--tp-ink);
  --muted: var(--tp-muted);
  --line: var(--tp-line);
  --surface: var(--tp-surface);
  --off-white: var(--tp-blue-50);
  --warm: var(--tp-paper);
  --shadow: var(--tp-shadow-md);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 106px;
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--tp-ink);
  background: #faf9f6;
  font-family:
    "Segoe UI",
    "Yu Gothic UI",
    "Hiragino Kaku Gothic ProN",
    "Noto Sans JP",
    system-ui,
    sans-serif;
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

/*
 * Japanese typography
 * Headings keep edited line breaks on wide screens, while the browser may
 * choose phrase-aware breaks on narrow screens. Body copy uses gentler
 * wrapping so short particles and punctuation are less likely to hang alone.
 */
:where(h1, h2, h3) {
  font-kerning: normal;
  font-feature-settings: "palt" 1;
  line-break: strict;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: auto-phrase;
}

:where(p, li, dd, summary) {
  line-break: strict;
  text-wrap: pretty;
  word-break: auto-phrase;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 4px;
}

::selection {
  color: white;
  background: var(--tp-blue-600);
}

.shell,
.section-shell {
  width: var(--tp-shell);
  margin-inline: auto;
}

.skip-link {
  z-index: 2000;
}

/* Shared header */

.site-header {
  border-bottom: 1px solid rgb(0 21 43 / 9%);
  background: rgb(250 249 246 / 90%);
  box-shadow: none;
  backdrop-filter: blur(20px) saturate(150%);
}

.site-header.is-scrolled {
  background: rgb(250 249 246 / 97%);
  box-shadow: 0 16px 46px rgb(0 18 38 / 7%);
}

.header-inner,
.header-shell {
  width: min(1440px, calc(100vw - 64px));
  min-height: 82px;
}

.brand {
  gap: 12px;
  color: var(--tp-navy-950);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.055em;
}

.brand img {
  width: 34px;
  height: 31px;
}

.site-nav {
  color: #263b50;
  font-size: 13px;
  font-weight: 650;
}

.nav-cta,
.mobile-consult,
.legal-header-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding-inline: 22px;
  color: white;
  background: var(--tp-navy-950);
  box-shadow: 0 12px 30px rgb(0 21 43 / 12%);
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms var(--tp-ease);
}

.nav-cta:hover,
.mobile-consult:hover,
.legal-header-link:hover {
  background: #123f6d;
  box-shadow: 0 16px 36px rgb(0 21 43 / 18%);
  transform: translateY(-1px);
}

/* Shared type hierarchy */

.section-label,
.section-kicker,
.eyebrow {
  color: var(--tp-blue-700);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
  line-height: 1.4;
}

.section-label span,
.section-kicker span {
  color: var(--tp-gold-600);
}

.display-title {
  max-width: 13ch;
  margin: 0;
  color: var(--tp-navy-950);
  font-size: clamp(2.75rem, 5.8vw, 5rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.25;
  text-wrap: balance;
}

.section-title {
  max-width: 18ch;
  margin: 0;
  color: var(--tp-navy-950);
  font-size: clamp(2.1rem, 4vw, 3.65rem);
  font-weight: 640;
  letter-spacing: -0.025em;
  line-height: 1.38;
  text-wrap: balance;
}

.lead-copy {
  max-width: var(--tp-measure);
  color: var(--tp-muted);
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.9;
}

/* Shared actions */

.button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 23px;
  border: 1px solid transparent;
  border-radius: var(--tp-radius-xs);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.025em;
  line-height: 1.35;
  text-decoration: none;
  transition:
    color 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms var(--tp-ease);
}

.button:hover {
  transform: translateY(-2px);
}

.button--primary,
.button:not([class*="button--"]) {
  color: white;
  background: var(--tp-navy-950);
  box-shadow: 0 16px 38px rgb(0 21 43 / 17%);
}

.button--primary:hover,
.button:not([class*="button--"]):hover {
  background: #123f6d;
  box-shadow: 0 20px 44px rgb(0 21 43 / 20%);
}

.button--secondary,
.button--line,
.button--ghost {
  border-color: var(--tp-line-strong);
  color: var(--tp-navy-950);
  background: rgb(255 255 255 / 76%);
  box-shadow: none;
}

.button--secondary:hover,
.button--line:hover,
.button--ghost:hover {
  border-color: var(--tp-navy-950);
  background: white;
}

.button--light {
  color: var(--tp-navy-950);
  background: white;
  box-shadow: 0 16px 42px rgb(0 0 0 / 14%);
}

.button--light:hover {
  color: white;
  background: var(--tp-blue-600);
}

.text-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 14px;
  color: var(--tp-navy-950);
  border-bottom: 1px solid var(--tp-line-strong);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    color 180ms ease;
}

.text-link:hover {
  color: var(--tp-blue-700);
  border-color: var(--tp-blue-600);
}

/* Shared media */

.media-frame {
  position: relative;
  overflow: hidden;
  padding: clamp(8px, 1vw, 14px);
  border: 1px solid rgb(173 191 208 / 68%);
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--tp-shadow-md);
}

.media-frame::before {
  position: absolute;
  z-index: 2;
  inset: 8px;
  border: 1px solid rgb(255 255 255 / 42%);
  content: "";
  pointer-events: none;
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-frame--editorial img {
  object-fit: cover;
}

.media-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 13px 0 0;
  color: #66778a;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

/* Shared footer */

.site-footer {
  color: white;
  background: linear-gradient(145deg, #071c31, var(--tp-navy-950) 58%, #000d1c);
}

.footer-main {
  border-bottom-color: rgb(255 255 255 / 13%);
}

.footer-brand,
.footer-brand strong,
.site-footer .brand {
  color: white;
}

.footer-nav p,
.footer-links p {
  color: #86b3e9;
}

.footer-nav a,
.footer-links a,
.footer-bottom {
  color: #c6d2de;
}

.footer-nav a:hover,
.footer-links a:hover,
.footer-bottom a:hover {
  color: white;
}

/* Utility pages */

.not-found,
.thanks-page {
  min-height: 100svh;
  color: var(--tp-ink);
  background: linear-gradient(145deg, var(--tp-paper), white);
}

.not-found {
  display: grid;
  place-items: center;
  padding: 32px;
}

.not-found > div,
.thanks-panel {
  width: min(720px, 100%);
  border: 1px solid var(--tp-line);
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--tp-shadow-lg);
  backdrop-filter: blur(16px);
}

.not-found > div {
  padding: clamp(34px, 7vw, 76px);
}

.not-found strong {
  display: block;
  margin-bottom: 20px;
  color: var(--tp-blue-600);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.not-found h1 {
  margin: 0 0 20px;
  color: var(--tp-navy-950);
  font-size: clamp(2.2rem, 6vw, 4.25rem);
  line-height: 1.3;
  text-wrap: balance;
}

.not-found p {
  max-width: 34rem;
  margin: 0 0 30px;
  color: var(--tp-muted);
}

.legacy-entry {
  min-height: 100svh;
  padding-top: 82px;
  background:
    linear-gradient(90deg, var(--tp-paper) 0 58%, var(--tp-navy-950) 58%);
}

.legacy-entry .site-header {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
}

.legacy-entry__panel {
  display: grid;
  width: min(1440px, 100%);
  min-height: calc(100svh - 82px);
  grid-template-columns: minmax(0, 7fr) minmax(400px, 5fr);
  align-items: center;
  margin-inline: auto;
}

.legacy-entry__copy {
  width: min(720px, calc(100% - 80px));
  justify-self: center;
  padding-block: 72px;
}

.legacy-entry__copy .lead-copy {
  margin-block: 30px;
}

.legacy-entry__actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.legacy-entry__note {
  margin: 22px 0 0;
  color: var(--tp-muted);
  font-size: 12px;
}

.legacy-entry__visual {
  position: relative;
  display: grid;
  width: min(430px, calc(100% - 64px));
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  border: 1px solid rgb(129 176 228 / 24%);
  color: #abc4de;
  background:
    linear-gradient(rgb(127 174 226 / 10%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(127 174 226 / 10%) 1px, transparent 1px),
    linear-gradient(145deg, #123f63, #06192a);
  background-size: 48px 48px, 48px 48px, auto;
  box-shadow: 0 34px 72px rgb(0 0 0 / 22%);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.legacy-entry__visual span {
  position: relative;
  z-index: 2;
  display: grid;
  width: 150px;
  min-height: 54px;
  place-items: center;
  border: 1px solid rgb(129 176 228 / 32%);
  background: rgb(5 32 55 / 88%);
}

.legacy-entry__visual i {
  width: 1px;
  height: 30px;
  background: linear-gradient(var(--tp-gold-500), var(--tp-blue-500));
}

@media (max-width: 900px) {
  :root {
    --tp-shell: min(100% - 40px, 1200px);
  }

  /*
   * A backdrop filter creates a containing block for fixed descendants.
   * The mobile navigation is fixed to the viewport, so keep the header
   * opaque on small screens and release the menu from the 72px header box.
   */
  .site-header,
  .site-header.is-scrolled {
    background: #fff;
    backdrop-filter: none;
  }

  .header-inner,
  .header-shell {
    width: min(100% - 40px, 1440px);
    min-height: 72px;
  }

  .legacy-entry {
    background: var(--tp-paper);
  }

  .legacy-entry__panel {
    grid-template-columns: 1fr;
  }

  .legacy-entry__visual {
    display: none;
  }
}

@media (max-width: 620px) {
  :root {
    --tp-shell: calc(100% - 32px);
    --tp-section-space: 4.75rem;
  }

  html {
    scroll-padding-top: 84px;
  }

  .header-inner,
  .header-shell {
    width: calc(100% - 32px);
  }

  .brand {
    font-size: 12px;
  }

  .brand img {
    width: 30px;
    height: 27px;
  }

  .button {
    min-height: 54px;
    gap: 18px;
    padding-inline: 19px;
  }

  .display-title {
    font-size: clamp(2.35rem, 11.5vw, 3.15rem);
    line-height: 1.32;
  }

  .section-title {
    font-size: clamp(1.9rem, 9vw, 2.5rem);
  }

  .type-break {
    display: none;
  }

  .media-frame {
    padding: 7px;
  }

  .legacy-entry {
    padding-top: 72px;
  }

  .legacy-entry__panel {
    min-height: calc(100svh - 72px);
  }

  .legacy-entry__copy {
    width: calc(100% - 32px);
    padding-block: 56px;
  }

  .legacy-entry__actions {
    display: grid;
    gap: 16px;
  }

  .legacy-entry__actions .button {
    width: 100%;
  }

  .not-found h1 {
    font-size: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .button,
  .media-frame,
  .site-header {
    border: 1px solid CanvasText;
  }
}
