/* ===== Design tokens (Layer 1 — Assort salon brand) ===== */

:root {
  /* Colors */
  --ink: #000000;
  --ink-2: #313131;
  --ink-3: #8a8a8a;
  --paper: #ffffff;
  --paper-2: #fafafa;
  --rule: #eeeeee;
  --accent: #e91e8a;
  --accent-hover: #c01775;

  /* Type families */
  --font-display: 'Cormorant Garamond', 'Noto Serif JP', serif;
  --font-body: 'Poppins', 'Noto Sans JP', system-ui, -apple-system, sans-serif;

  /* Type scale (mobile-first) */
  --fs-hero: clamp(2.25rem, 4vw + 1rem, 4rem);          /* 36–64px */
  --fs-h2: clamp(1.5rem, 2vw + 0.75rem, 2rem);          /* 24–32px */
  --fs-h3: clamp(1.125rem, 1vw + 0.75rem, 1.375rem);    /* 18–22px */
  --fs-body: clamp(0.9375rem, 0.25vw + 0.85rem, 1rem);  /* 15–16px */
  --fs-caption: clamp(0.75rem, 0.15vw + 0.7rem, 0.8125rem); /* 12–13px */
  --fs-eyebrow: 0.75rem; /* 12px */

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --max-content: 1280px;
  --max-prose: 720px;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration: 250ms;
}

/* ===== Reset / base ===== */

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--ink); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--accent); }

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

/* ===== Typography utilities ===== */

.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-eyebrow);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 var(--space-3);
}

h1, .h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 var(--space-4);
}

h2, .h2 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 var(--space-4);
}

h3, .h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 var(--space-3);
}

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ===== Layout ===== */

.section { padding: var(--space-16) var(--gutter); }
@media (min-width: 1024px) { .section { padding: var(--space-24) var(--gutter); } }

.section--alt { background: var(--paper-2); }

.container { max-width: var(--max-content); margin: 0 auto; }
.container--prose { max-width: var(--max-prose); margin: 0 auto; }

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-8);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 6px;
  border: 0;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--paper);
}
.btn--primary:hover { background: var(--accent-hover); color: var(--paper); transform: scale(1.02); }

.btn--secondary {
  background: transparent;
  color: var(--ink-2);
  padding-left: 0;
  padding-right: 0;
}
.btn--secondary:hover { color: var(--accent); }
.btn--secondary::after {
  content: '';
  display: block;
  height: 1px;
  background: currentColor;
  margin-top: 2px;
  transition: background var(--duration) var(--ease);
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.btn--outline:hover { background: var(--accent); color: var(--paper); transform: scale(1.02); }

@media (max-width: 640px) {
  .btn--primary,
  .btn--outline { display: flex; width: 100%; justify-content: center; }
}

/* ===== Header ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: var(--space-4) var(--gutter);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-content);
  margin: 0 auto;
}

.site-header__logo { height: 28px; width: auto; }

/* Language switcher — native <select> dropdown */
.lang-switcher {
  display: flex;
  align-items: center;
}

.lang-select {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}
.lang-select:hover { color: var(--ink); border-color: var(--ink-3); }

/* ===== Hero ===== */

.hero { padding: var(--space-12) var(--gutter) 0; }

.hero__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  gap: var(--space-12);
}

.hero__copy { display: grid; gap: var(--space-6); align-self: center; }

.hero__headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: var(--fs-hero);
  line-height: 1.1;
  color: var(--ink);
}

.hero__tagline {
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 38ch;
}

.hero__ctas { display: flex; gap: var(--space-6); align-items: center; flex-wrap: wrap; }

.hero__photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
}

@media (min-width: 1024px) {
  .hero { padding-top: var(--space-16); }
  .hero__inner { grid-template-columns: 1fr; }
}

/* ===== Philosophy ===== */

.philosophy { padding: var(--space-24) var(--gutter); }
.philosophy__inner { max-width: var(--max-prose); margin: 0 auto; text-align: center; }
.philosophy__body { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.8; }

/* ===== Training ===== */

.training { position: relative; }
.training .container--prose { position: relative; z-index: 1; }
.training__worldmap {
  position: absolute;
  inset: 0;
  background-image: url('/photos/assort-world-map.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.training__bullets { list-style: none; padding: 0; margin: var(--space-8) 0 0; display: grid; gap: var(--space-4); }
.training__bullets li { padding-left: var(--space-6); position: relative; }
.training__bullets li::before { content: '—'; position: absolute; left: 0; color: var(--accent); }

/* ===== Salary section — per-country "Example:" blocks ===== */
/* Each .salary-block renders an i18n HTML fragment beginning with
   <p><strong>Example: <country></strong></p>. Without spacing the second
   block (Australia) butts against the first (Japan); add breathing room above
   each block and a small accent location-pin before each country heading.
   Styling only — the i18n strings are untouched. */
.salary-block { margin-top: var(--space-8); }
.salary-block > p:first-child strong {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.salary-block > p:first-child strong::before {
  content: "";
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  position: relative;
  top: 0.04em;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23e91e8a'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M21%2010c0%207-9%2013-9%2013s-9-6-9-13a9%209%200%200%201%2018%200z'/%3E%3Ccircle%20cx='12'%20cy='10'%20r='3'/%3E%3C/svg%3E");
}
.salary-overseas { margin-top: var(--space-6); }

/* ===== Accordions (native <details>) ===== */

.accordion { border-top: 1px solid var(--rule); }
.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-6) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  transition: color var(--duration) var(--ease);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: '+';
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--ink-3);
  transition: transform var(--duration) var(--ease);
}
.accordion[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.accordion summary:hover { color: var(--accent); }

.accordion__body {
  padding: var(--space-4) 0 var(--space-8);
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
}

/* ===== Career paths ===== */

.paths { display: grid; gap: var(--space-6); }
@media (min-width: 1024px) { .paths { grid-template-columns: repeat(4, 1fr); } }

.path-card {
  padding: var(--space-8);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.path-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.path-card__title { font-family: var(--font-body); font-weight: 600; font-size: 1.125rem; color: var(--ink); margin: 0; }
.path-card__desc { color: var(--ink-2); font-size: 0.9375rem; margin: 0; flex: 1; }
.path-card__link { font-size: 0.875rem; font-weight: 600; color: var(--accent); margin-top: auto; }

/* ===== Locations ===== */

.locations { position: relative; }
.locations__worldmap {
  position: absolute;
  inset: 0;
  background-image: url('/photos/assort-world-map.png');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.08;
  pointer-events: none;
}
.locations__grid { display: grid; gap: var(--space-6); position: relative; z-index: 1; }
@media (min-width: 640px) { .locations__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .locations__grid { grid-template-columns: repeat(4, 1fr); } }

.location-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--duration) var(--ease);
}
.location-card:hover { transform: translateY(-2px); }
.location-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.location-card__photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
}
.location-card__name { font-weight: 600; font-size: 1rem; color: var(--ink); margin: 0; }
.location-card__city { font-size: 0.875rem; color: var(--ink-3); margin: 0; }
.location-card__status {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  align-self: flex-start;
}
.location-card__status--open { background: var(--accent); color: var(--paper); }
.location-card__status--inquiry { background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--rule); }

/* ===== Final CTA ===== */

.final-cta {
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-24) var(--gutter);
  text-align: center;
}
.final-cta .eyebrow { color: var(--accent); }
.final-cta__headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  line-height: 1.15;
  color: var(--paper);
  margin: 0 0 var(--space-8);
}

/* ===== Footer ===== */

.site-footer {
  padding: var(--space-16) var(--gutter) var(--space-8);
  border-top: 1px solid var(--rule);
}
.site-footer__inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  gap: var(--space-8);
}
@media (min-width: 1024px) { .site-footer__inner { grid-template-columns: 1fr 1fr 1fr; } }

.site-footer__col h4 { font-size: 0.875rem; color: var(--ink-3); margin: 0 0 var(--space-3); font-weight: 600; }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.site-footer__col a { color: var(--ink-2); font-size: 0.875rem; }
.site-footer__col a:hover { color: var(--accent); }

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-top: var(--space-8);
  margin-top: var(--space-8);
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.ig-icons { display: flex; gap: var(--space-4); }
.ig-icons a { color: var(--ink-3); }
.ig-icons a:hover { color: var(--accent); }
.ig-icons svg { width: 18px; height: 18px; }

/* ===== Floating chat button ===== */

.chat-button {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: var(--accent);
  color: var(--paper);
  border: 0;
  border-radius: 100px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  box-shadow: 0 6px 24px -8px rgba(233, 30, 138, 0.5);
  cursor: pointer;
  transition: background var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.chat-button:hover { background: var(--accent-hover); transform: scale(1.04); }

@media (max-width: 640px) {
  .chat-button {
    padding: var(--space-3);
    border-radius: 100%;
    width: 56px;
    height: 56px;
    justify-content: center;
  }
  .chat-button__label { display: none; }
}

/* ===== Chat modal — bottom-sheet pattern (mirrors V10 Sales Coach) =====
   Architecture: .chat-modal is a fixed-inset positioning context only.
   Two children: .chat-modal__backdrop (full-cover dim layer) and
   .chat-modal__panel (anchored bottom:0 — sticks to the visible viewport
   edge so the iOS keyboard never scrolls the panel header off-screen). */

.chat-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
.chat-modal[open] { display: block; }

.chat-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.chat-modal__panel {
  /* MOBILE DEFAULT: V10 bottom-sheet pattern — panel anchored to visible
     viewport bottom so the iOS keyboard never scrolls the header off-screen. */
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin-inline: auto;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  max-height: 80dvh;
  background: var(--paper);
  border-radius: 16px 16px 0 0;
  padding: var(--space-6) var(--space-6) var(--space-4);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

/* DESKTOP (≥641px, matches the sitewide mobile breakpoint): conventional
   centered modal dialog. No iOS keyboard concern, and a panel "attached"
   to the bottom edge of a tall desktop viewport looks awkward. */
@media (min-width: 641px) {
  .chat-modal[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gutter);
  }
  .chat-modal__panel {
    /* position: relative (not static) so the panel paints ABOVE the
       absolutely-positioned .chat-modal__backdrop sibling. Per CSS
       painting rules, positioned elements paint above static ones
       regardless of DOM order. */
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin: 0;
    border-radius: 12px;
    max-height: 80vh;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  }
}

.chat-modal__title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--ink);
  margin: 0;
}

.chat-modal__close {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  padding: var(--space-2) var(--space-4);
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.chat-modal__close:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Roles section (Layer 2) ===== */
/* .section.roles uses the shared .paths grid + .path-card cards already defined above.
   .role-card is a semantic alias kept for template parity; it inherits .path-card styles. */

.role-card {
  padding: var(--space-8);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.role-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.role-card__title { font-family: var(--font-body); font-weight: 600; font-size: 1.125rem; color: var(--ink); margin: 0; }
.role-card__desc  { color: var(--ink-2); font-size: 0.9375rem; margin: 0; flex: 1; }
.role-card__link  { font-size: 0.875rem; font-weight: 600; color: var(--accent); margin-top: auto; }

/* Spacing between LOCATIONS photo-card grid and the per-country accordion block */
.locations__grid + .country-card { margin-top: var(--space-12); }

/* ===== Per-country facts table (inside .accordion.country-card) ===== */
/* .country-card extends .accordion — open/close chevron + border inherited above.
   No duplicate accordion rules needed; add only the facts-specific overrides. */

/* Scroll offset so a location-card click doesn't tuck the accordion under the sticky header. */
.country-card { scroll-margin-top: 6rem; }

.country-card summary {
  font-size: var(--fs-h3);
}

dl.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
}

dl.facts dt {
  grid-column: 1;
  font-weight: 600;
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  /* Accent rule on the left edge of each key */
  border-left: 2px solid var(--accent);
  padding-left: var(--space-3);
}

dl.facts dt:first-of-type { border-top: 1px solid var(--rule); }

dl.facts dd {
  grid-column: 2;
  margin: 0;
  color: var(--ink-2);
  font-size: var(--fs-body);
  padding: var(--space-3) 0 var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rule);
  word-break: break-word;
}

dl.facts dd:first-of-type { border-top: 1px solid var(--rule); }

/* Mobile: stack key above value */
@media (max-width: 640px) {
  dl.facts {
    grid-template-columns: 1fr;
  }
  dl.facts dt {
    white-space: normal;
    padding-bottom: var(--space-1);
    border-bottom: 0;
  }
  dl.facts dd {
    padding-left: var(--space-3);
    padding-top: 0;
    margin-bottom: var(--space-3);
    border-top: 0;
    border-left: 2px solid var(--rule);
  }
  dl.facts dd:first-of-type { border-top: 0; }
}

/* Loading spinner — Ken-locked: every async action shows one. Shared across the
   applicant pages (apply/experience/trial/final/onboarding-start). Keep in sync
   with public/onboarding-documents.css + public/admin/app.css. */
.spinner { display: inline-block; width: .85em; height: .85em; vertical-align: -.12em; margin-right: 6px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
