/* ==========================================================================
   Components: buttons, nav, accordion, modal, hero editor
   ========================================================================== */

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--radius);
  font: 600 0.9rem/1 var(--font); letter-spacing: -0.005em;
  text-decoration: none; white-space: nowrap;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-coral { background: var(--coral); color: var(--navy); }
.btn-coral:hover { background: #ff9580; }
.btn-indigo { background: var(--indigo); color: #fff; }
.btn-indigo:hover { background: var(--indigo-deep); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }
.on-dark .btn-ghost { border-color: var(--line-dark); color: var(--on-dark); }
.on-dark .btn-ghost:hover { border-color: var(--on-dark); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font: 600 0.88rem/1.2 var(--font);
  text-decoration: none; background: none; border: 0; padding: 0;
  position: relative; transition: gap 0.25s var(--ease), color 0.25s var(--ease);
}
.link-arrow::after { content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 1px; background: currentColor; }
.link-arrow svg { width: 14px; height: 14px; }
.link-arrow:hover { gap: 15px; color: var(--indigo); }
.on-dark .link-arrow:hover { color: var(--coral); }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--cream-2);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); }
.nav-logo { margin-right: auto; display: block; flex: none; }
.nav-logo img { height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: clamp(22px, 2.8vw, 40px); }
.nav-links a {
  position: relative; text-decoration: none;
  font-size: 0.92rem; font-weight: 500; color: var(--ink-soft);
  padding-block: 8px; transition: color 0.2s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }
.nav-cta { display: none; }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  position: relative; flex: none;
}
.nav-toggle span {
  position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* ---------- FAQ accordion ---------- */
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px 0; background: none; border: 0; text-align: left;
  font: 500 clamp(1rem, 0.95rem + 0.3vw, 1.2rem)/1.3 var(--font); letter-spacing: -0.015em;
  transition: color 0.2s;
}
.faq-q:hover { color: var(--indigo); }
.faq-icon { position: relative; flex: none; width: 14px; height: 14px; }
.faq-icon::before, .faq-icon::after {
  content: ""; position: absolute; background: var(--indigo);
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
.faq-icon::before { left: 0; right: 0; top: 6.25px; height: 1.5px; }
.faq-icon::after  { top: 0; bottom: 0; left: 6.25px; width: 1.5px; }
.faq-q[aria-expanded="true"] .faq-icon::after { transform: scaleY(0); }
.faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease); }
.faq-a > div { overflow: hidden; }
.faq-a p { padding: 0 40px 22px 0; color: var(--ink-soft); max-width: 44em; }
.faq-q[aria-expanded="true"] + .faq-a { grid-template-rows: 1fr; }

/* ---------- request modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 300;
  display: none; align-items: center; justify-content: center;
  padding: clamp(12px, 3vw, 32px);
}
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9, 10, 30, 0.78); animation: fade 0.3s var(--ease); }
.m-dialog {
  position: relative; width: 100%; max-width: 960px;
  max-height: calc(100dvh - 2 * clamp(12px, 3vw, 32px)); overflow: auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  background: var(--cream); color: var(--ink);
  animation: rise 0.4s var(--ease);
  overscroll-behavior: contain;
}
.m-aside {
  position: relative; overflow: hidden;
  background: var(--navy); color: var(--on-dark);
  padding: clamp(28px, 3.4vw, 44px);
  display: flex; flex-direction: column;
}
.m-aside::after { /* quiet orbit, echoes the closing section */
  content: ""; position: absolute; right: -30%; bottom: -22%; width: 90%; aspect-ratio: 1;
  border-radius: 50%; border: 1px solid rgba(143, 140, 245, 0.2);
  box-shadow: 0 0 0 38px rgba(143, 140, 245, 0.04), 0 0 0 76px rgba(255, 127, 102, 0.05);
  pointer-events: none;
}
.m-aside h2 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); line-height: 1; margin: 18px 0 14px; color: #fff; }
.m-aside p { color: var(--on-dark-soft); max-width: 24em; }
.m-mail { margin-top: auto; padding-top: 32px; font-size: 0.85rem; position: relative; z-index: 1; }
.m-mail a { color: #fff; text-underline-offset: 3px; }
.m-main { position: relative; padding: clamp(28px, 3.4vw, 44px); }
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px;
  display: grid; place-items: center; background: none; border: 0; color: var(--ink-soft);
  transition: color 0.2s;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { color: var(--ink); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.form { display: grid; gap: 22px; }
.form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form legend, .field label {
  display: block; padding: 0; margin-bottom: 8px;
  font: 500 var(--fs-label)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.84rem; font-weight: 500; color: var(--ink);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--indigo); outline-offset: 2px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: grid; align-content: start; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: max(16px, 1rem); color: var(--ink);
  padding: 10px 0; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--indigo); box-shadow: 0 1px 0 var(--indigo); }
.field.has-error input { border-bottom-color: var(--coral-deep); box-shadow: 0 1px 0 var(--coral-deep); }
.field-error { font-size: 0.78rem; color: var(--coral-deep); min-height: 1.2em; margin-top: 4px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-note { font-size: 0.78rem; color: var(--ink-faint); max-width: 22em; }

.form-done { display: none; padding-block: 24px; }
.m-dialog.is-done .form { display: none; }
.m-dialog.is-done .form-done { display: block; }
.form-done .tick { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--indigo); position: relative; margin-bottom: 24px; }
.form-done .tick::after { content: ""; position: absolute; left: 15px; top: 9px; width: 10px; height: 18px; border: solid var(--indigo); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.form-done h3 { font-size: 1.6rem; margin-bottom: 12px; }
.form-done p { color: var(--ink-soft); margin-bottom: 24px; max-width: 28em; }
.form-done .row { display: flex; flex-wrap: wrap; gap: 10px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 400;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--navy); color: var(--on-dark); max-width: calc(100vw - 32px);
  padding: 13px 18px; font-size: 0.88rem; border-left: 3px solid var(--coral);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- form states ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-alert { display: none; padding: 12px 14px; border-left: 3px solid var(--coral-deep); background: #fdece8; color: #7a2a1a; font-size: 0.88rem; line-height: 1.45; }
.form-alert.is-show { display: block; }
.form-alert a { color: inherit; font-weight: 600; }
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-loading svg { animation: btn-spin 0.9s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
