/* ==========================================================
   tidesmack · shared design system
   Extracted from the homepage ("the transformation stage").
   Used by every TideSmack-owned page: /quote/, /privacy/,
   /terms/, /accessibility/. The homepage keeps its own inline
   copy of these tokens — change both together.
   ========================================================== */

:root {
  --font-display: "Instrument Serif", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;

  /* brand gradient: cyan → violet → pink → red-orange → amber */
  --g1: #46c6e4;
  --g2: #8b8bf4;
  --g3: #ef6ac0;
  --g4: #fb6a5f;
  --g5: #f9a03f;
  --grad: linear-gradient(92deg, var(--g1) 0%, var(--g2) 26%, var(--g3) 52%, var(--g4) 76%, var(--g5) 100%);

  --ease: cubic-bezier(.22, .9, .3, 1);
  --speed: 320ms;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c13;
  --bg-2: #0e111b;
  --text: #eef0f6;
  --text-dim: #a4abbd;
  --text-faint: #828ba1;
  --line: rgba(238, 240, 246, 0.1);
  --line-strong: rgba(238, 240, 246, 0.18);
  --panel: rgba(21, 25, 38, 0.62);
  --panel-solid: #12151f;
  --panel-raised: #171b28;
  --glass: rgba(16, 19, 30, 0.72);
  --menu-bg: rgba(13, 16, 25, 0.97);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.35);
  --mark-ink: #eef0f6;
  --accent-ink: #7cd6ec;
  --chip-bg: rgba(238, 240, 246, 0.06);
  --field-bg: rgba(18, 21, 31, 0.74);
  --error-ink: #ff9d90;
  --success-ink: #7de0c3;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f3ee;
  --bg-2: #efece5;
  --text: #14161e;
  --text-dim: #4d5262;
  --text-faint: #5b6172;
  --line: rgba(20, 22, 30, 0.11);
  --line-strong: rgba(20, 22, 30, 0.2);
  --panel: rgba(255, 255, 255, 0.66);
  --panel-solid: #fdfcf9;
  --panel-raised: #ffffff;
  --glass: rgba(252, 251, 247, 0.8);
  --menu-bg: rgba(250, 249, 245, 0.97);
  --shadow: 0 24px 60px rgba(35, 32, 24, 0.14);
  --shadow-soft: 0 10px 28px rgba(35, 32, 24, 0.1);
  --mark-ink: #171c33;
  --accent-ink: #08627a;
  --chip-bg: rgba(20, 22, 30, 0.05);
  --field-bg: rgba(255, 255, 255, 0.76);
  --error-ink: #b33528;
  --success-ink: #0c7a5b;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease);
  overflow-x: clip;
}

::selection { background: var(--g3); color: #fff; }

h1, h2, h3 { line-height: 1.06; font-weight: 600; }
a { color: inherit; }
img, svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; }

:focus-visible {
  outline: 2px solid var(--g1);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--text); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: 8px; text-decoration: none;
  transition: top 200ms var(--ease);
}
.skip-link:focus { top: 14px; }

/* film grain over everything, very quiet */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 120;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}
[data-theme="light"] body::after { opacity: 0.035; }

.wrap { width: min(1240px, 100% - 3rem); margin-inline: auto; }

/* ==========================================================
   brand mark
   ========================================================== */
.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark .mark-t { fill: var(--mark-ink); transition: fill var(--speed) var(--ease); }
.brand-name {
  font-family: var(--font-body);
  font-weight: 700; font-size: 1.22rem; letter-spacing: -0.03em;
  color: var(--text);
}

/* ==========================================================
   header
   ========================================================== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-soft);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 1.5rem;
  height: 68px;
}
.header-inner .brand { justify-self: start; }
.primary-nav { justify-self: center; }
.primary-nav ul { display: flex; gap: 1.9rem; list-style: none; }
.primary-nav a {
  text-decoration: none; font-size: 0.92rem; font-weight: 500;
  color: var(--text-dim);
  position: relative; padding: 0.3rem 0;
  transition: color 180ms var(--ease);
}
.primary-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 2px; border-radius: 2px; background: var(--grad);
  transition: right 260ms var(--ease);
}
.primary-nav a:hover { color: var(--text); }
.primary-nav a:hover::after { right: 0; }
.primary-nav a[aria-current="page"] { color: var(--text); }
.primary-nav a[aria-current="page"]::after { right: 0; }

.header-side { display: flex; align-items: center; gap: 1.1rem; justify-self: end; }
.header-email {
  font-size: 0.88rem; color: var(--text-dim); text-decoration: none;
  transition: color 180ms var(--ease);
}
.header-email:hover { color: var(--text); }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
}
.theme-toggle:hover { transform: rotate(15deg); border-color: var(--text-faint); }
.theme-toggle svg { width: 17px; height: 17px; stroke: var(--text); fill: none; stroke-width: 1.8; stroke-linecap: round; }
[data-theme="dark"] .toggle-sun { display: block; }
[data-theme="dark"] .toggle-moon { display: none; }
[data-theme="light"] .toggle-sun { display: none; }
[data-theme="light"] .toggle-moon { display: block; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.82rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background var(--speed) var(--ease);
  position: relative;
}
.btn-primary {
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,0) 45%),
    linear-gradient(92deg, #2ba6c9, #6f6fe8 30%, #d94fa8 58%, #f0563f 82%, #ef8f2e);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 10px 26px rgba(217, 79, 168, 0.32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 16px 34px rgba(217, 79, 168, 0.42); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; transform: none; cursor: default; }
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--chip-bg);
}
.btn-ghost:hover { transform: translateY(-2px); border-color: var(--text-faint); }
.btn-compact { padding: 0.6rem 1.15rem; font-size: 0.88rem; }

/* mobile menu */
.menu-button {
  display: none;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line-strong);
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-button .bar {
  width: 16px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform 260ms var(--ease), opacity 260ms var(--ease);
}
.menu-button[aria-expanded="true"] .bar:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-button[aria-expanded="true"] .bar:last-child { transform: translateY(-3.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 68px 0 auto 0; z-index: 99;
  background: var(--menu-bg);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem 1.8rem;
  display: none;
}
.mobile-menu.is-open { display: block; }
.mobile-menu ul { list-style: none; display: grid; gap: 0.15rem; }
.mobile-menu li a {
  display: block; padding: 0.75rem 0.4rem;
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 400;
  text-decoration: none; border-bottom: 1px solid var(--line);
}
.js .mobile-menu.is-open li { animation: menu-in 420ms var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes menu-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.mobile-menu-foot { margin-top: 1.3rem; display: grid; gap: 0.8rem; }
.mobile-menu-foot .header-email { font-size: 0.95rem; }

/* ==========================================================
   sections — shared
   ========================================================== */
section { position: relative; }
.section-pad { padding: clamp(4.5rem, 9vh, 7.5rem) 0; }
.section-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.9rem;
}
.section-head { max-width: 620px; margin-bottom: clamp(2.2rem, 5vh, 3.4rem); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.6rem);
  font-weight: 400;
  line-height: 1.16; padding-bottom: 0.06em;
  letter-spacing: -0.01em;
}
.section-head p { margin-top: 0.9rem; color: var(--text-dim); max-width: 54ch; }

/* scroll reveal */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: var(--rd, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================
   footer
   ========================================================== */
.site-footer { border-top: 1px solid var(--line); padding: 2.2rem 0 2.6rem; margin-top: auto; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; flex-wrap: wrap;
}
.footer-meta { font-size: 0.84rem; color: var(--text-faint); display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-meta a { color: var(--text-dim); text-decoration: none; }
.footer-meta a:hover { color: var(--text); }
.footer-grad { height: 3px; border-radius: 3px; background: var(--grad); margin-bottom: 2rem; opacity: 0.85; }

/* ==========================================================
   page hero — shared by documents and the quote builder
   ========================================================== */
.page-hero {
  position: relative;
  padding: clamp(8rem, 14vh, 10.5rem) 0 clamp(2.6rem, 5vh, 3.8rem);
  overflow: clip;
}
.page-aurora {
  position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: -55%;
  width: min(920px, 110vw); aspect-ratio: 1.35;
  transform: translateX(-50%);
  background:
    radial-gradient(38% 42% at 32% 42%, rgba(70,198,228,.26), transparent 70%),
    radial-gradient(36% 40% at 62% 34%, rgba(139,139,244,.22), transparent 70%),
    radial-gradient(34% 42% at 74% 62%, rgba(239,106,192,.18), transparent 70%);
  filter: blur(46px);
}
[data-theme="light"] .page-aurora { opacity: 0.55; }
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  line-height: 1.12; padding-bottom: 0.08em;
  letter-spacing: -0.015em;
  max-width: 22ch;
}
.page-hero h1 em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  padding-right: 0.05em;
}
.page-lede { margin-top: 1.1rem; color: var(--text-dim); max-width: 56ch; font-size: 1.06rem; }
.page-meta { margin-top: 1.1rem; font-size: 0.88rem; color: var(--text-faint); }

/* ==========================================================
   documents — privacy / terms / accessibility
   ========================================================== */
.document-rule { height: 3px; border-radius: 3px; background: var(--grad); opacity: 0.85; width: min(16rem, 45%); margin-top: 1.6rem; }
.document { width: min(46rem, 100% - 3rem); margin-inline: auto; padding: clamp(2.5rem, 6vh, 4rem) 0 clamp(5rem, 10vh, 7.5rem); }
.document > p { color: var(--text-dim); }
.document p + p { margin-top: 1rem; }
.document h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  line-height: 1.2; padding-bottom: 0.05em;
  margin: 2.8rem 0 0.8rem;
}
.document h2::before {
  content: "";
  display: block;
  width: 34px; height: 4px; border-radius: 3px;
  background: var(--grad);
  margin-bottom: 1rem;
}
.document h3 { margin: 1.8rem 0 0.5rem; font-size: 1.05rem; }
.document ul { padding-left: 1.25rem; color: var(--text-dim); display: grid; gap: 0.35rem; }
.document a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.document a:hover { text-decoration-thickness: 2px; }

/* ==========================================================
   quote builder
   ========================================================== */
.quote-layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(19rem, .75fr);
  gap: clamp(1.6rem, 4vw, 3.5rem);
  align-items: start;
  padding-bottom: clamp(5rem, 10vh, 8rem);
}
.quote-form { display: grid; gap: 1.1rem; }

.form-section {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: clamp(1.4rem, 3vw, 2.1rem);
  transition: border-color 240ms var(--ease);
}
.form-section:focus-within { border-color: var(--line-strong); }
.form-section legend { float: left; width: 100%; padding: 0; }
.form-section legend + * { clear: both; }
.step-head { display: flex; align-items: baseline; gap: 0.85rem; margin-bottom: 0.35rem; }
.step-num {
  font-family: var(--font-display); font-style: italic;
  font-size: 1rem; color: var(--text-faint);
  flex: none;
}
.step-head h2, .form-section legend .step-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.65rem; line-height: 1.15; padding-bottom: 0.05em;
}
.step-note { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 1.3rem; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.45rem; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field small { color: var(--text-faint); font-weight: 400; }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"], select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--text);
  padding: 0.8rem 0.9rem;
  transition: border-color 180ms var(--ease), background var(--speed) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--text-faint); }
textarea { min-height: 9rem; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; background-image: linear-gradient(45deg, transparent 49%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 51%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem 1rem; }
.check {
  display: flex; gap: 0.65rem; align-items: flex-start;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--chip-bg);
  cursor: pointer;
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}
.check:hover { border-color: var(--text-faint); color: var(--text); }
.check:has(input:checked) { border-color: var(--g2); color: var(--text); }
.check input { width: 1.1rem; height: 1.1rem; margin-top: 0.2rem; flex: none; accent-color: var(--g2); }
.check.plain { border: 0; background: none; padding: 0.2rem 0; }

.honeypot { position: absolute; left: -9999px; }

.form-submit { padding: 0.4rem 0.2rem 0; }
.form-status { color: var(--text-dim); font-size: 0.88rem; margin-top: 1rem; }
.form-status[data-state="error"] { color: var(--error-ink); }
.form-status[data-state="success"] { color: var(--success-ink); }
.email-fallback { display: none; margin-top: 1rem; }
.email-fallback.is-visible { display: inline-flex; }

/* estimate card — gradient framed, like the featured price card */
.estimate {
  position: sticky; top: 6.5rem;
  border-radius: 20px;
  padding: 2px;
  background: var(--grad);
  box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 0 50px rgba(139, 139, 244, 0.16);
}
[data-theme="light"] .estimate { box-shadow: 0 22px 50px rgba(35,32,24,.16), 0 0 44px rgba(239,106,192,.12); }
.estimate-inner {
  border-radius: 18px;
  background: var(--panel-solid);
  padding: clamp(1.5rem, 2.6vw, 2rem);
  display: grid; gap: 0.55rem;
  transition: background var(--speed) var(--ease);
}
.estimate .section-tag { margin-bottom: 0.1rem; }
.estimate h2 { font-size: 1.15rem; font-weight: 600; }
.estimate-output { padding: 1rem 0 1.1rem; border-bottom: 1px solid var(--line); }
.estimate-range {
  display: block;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.6rem); line-height: 1.1;
  padding-bottom: 0.05em;
}
.estimate-reasons { list-style: none; display: grid; gap: 0.5rem; margin-top: 0.9rem; }
.estimate-reasons li { font-size: 0.88rem; color: var(--text-dim); padding-left: 1.35rem; position: relative; }
.estimate-reasons li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 12px; height: 5px; border-radius: 3px; background: var(--grad);
}
#estimate-management { font-size: 0.88rem; color: var(--text-dim); }
.estimate-note { font-size: 0.82rem; color: var(--text-faint); }

/* ==========================================================
   responsive
   ========================================================== */
@media (max-width: 980px) {
  .quote-layout { grid-template-columns: 1fr; }
  .estimate { position: static; order: -1; }
}

@media (max-width: 820px) {
  .site-header { inset: .65rem .7rem auto; right: .7rem; border: 0; }
  .site-header.is-scrolled { background: transparent; border: 0; box-shadow: none; }
  .header-inner { width: 100%; min-height: 58px; height: auto; padding: .42rem .5rem .42rem .8rem; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow-soft); }
  .primary-nav, .header-side .header-email, .header-cta { display: none; }
  .header-inner { grid-template-columns: 1fr auto; }
  .menu-button { display: inline-flex; }
  .mobile-menu { inset: 5rem .7rem auto; border: 1px solid var(--line-strong); border-radius: 18px; }
  .page-hero { padding-top: clamp(7rem, 12vh, 8.5rem); }
  .fields, .checks { grid-template-columns: 1fr; }
  .form-submit .btn { width: 100%; }
  .email-fallback.is-visible { display: flex; }
}

@media (max-width: 560px) {
  .wrap { width: min(1240px, 100% - 1.6rem); }
  .document { width: min(46rem, 100% - 1.6rem); }
}

/* ==========================================================
   reduced motion / transparency
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header.is-scrolled, .mobile-menu, .form-section { background: var(--panel-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
