@import "tokens.css";

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0;
  background: var(--surface-primary);
  color: var(--text-primary);
  font-family: var(--font-web);
  font-size: var(--web-body);
  line-height: var(--lh-body);
}
a { color: var(--text-link); text-decoration: none; }
a:hover { color: #F3F5F9; }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 3px; border-radius: var(--radius-xs); }
img { display: block; max-width: 100%; }

.skip-link {
  position: absolute; left: 12px; top: -48px;
  background: var(--surface-raised); color: var(--text-primary);
  padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-2);
  z-index: 100; transition: top var(--duration-fast) var(--ease-standard);
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); margin: 0;
}

.page {
  container-type: inline-size;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  max-width: var(--web-container); margin: 0 auto; width: 100%;
  padding: 0 clamp(16px, 2.2cqw, 24px);
  height: 64px; box-sizing: border-box;
  display: flex; align-items: center; gap: clamp(12px, 1.5cqw, 24px);
}
.wordmark {
  display: flex; align-items: center; gap: 8px; color: var(--text-primary);
  border-radius: var(--radius-xs);
}
.wordmark img { width: 28px; height: 28px; }
.wordmark span {
  font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden;
  max-width: clamp(0px, calc((100cqw - 400px) * 50), 200px);
}
.site-nav { display: flex; align-items: center; gap: clamp(12px, 1.5cqw, 28px); margin-left: auto; }
.site-nav a { font-size: 14px; color: var(--text-secondary); padding: 4px 0; }
.site-nav a[aria-current="page"] { color: var(--text-primary); font-weight: 500; }

/* App Store badge */
.badge {
  display: inline-flex; flex-direction: column; justify-content: center;
  height: 32px; padding: 0 10px;
  background: #000; color: #fff; border: 1px solid #A6A6A6; border-radius: 6px;
  line-height: 1; white-space: nowrap;
}
.badge span:first-child { font-size: 7px; font-family: var(--font-app); letter-spacing: 0.01em; }
.badge span:last-child { font-size: 13px; font-weight: 600; font-family: var(--font-app); margin-top: 1px; }
.badge--lg { height: 44px; padding: 0 14px; border-radius: 7px; }
.badge--lg span:first-child { font-size: 9px; }
.badge--lg span:last-child { font-size: 18px; margin-top: 2px; }

/* Buttons (design-system Button, secondary variant only — used sparingly) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 18px; font-family: inherit; font-size: 15px; font-weight: 500;
  line-height: 1; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--action-secondary); color: var(--action-secondary-text);
  border: 1px solid var(--action-secondary-border); box-shadow: var(--shadow-1);
  transition: background var(--duration-fast) var(--ease-standard);
}
.btn:hover { background: var(--action-secondary-hover); }

/* Main content sections */
main { flex: 1; }
.section {
  max-width: var(--web-container); margin: 0 auto;
  padding: clamp(64px, 6.7cqw, 96px) clamp(16px, 2.2cqw, 24px) 0;
  display: flex; flex-direction: column; gap: clamp(24px, 3cqw, 40px);
}
.section h2 {
  margin: 0; font-size: clamp(1.5rem, 2.6cqw, 2rem); line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading); font-weight: 600;
}

/* Hero */
.hero {
  max-width: var(--web-container); margin: 0 auto;
  padding: clamp(40px, 5cqw, 72px) clamp(16px, 2.2cqw, 24px) 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: clamp(32px, 4cqw, 56px); align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: clamp(16px, 2cqw, 24px); }
.hero-copy h1 {
  margin: 0; font-size: clamp(2.25rem, 5cqw, 3.5rem); line-height: var(--lh-display);
  letter-spacing: var(--ls-display); font-weight: 700; text-wrap: pretty;
}
.hero-copy > p:first-of-type {
  margin: 0; font-size: var(--web-body-lg); color: var(--text-secondary);
  text-wrap: pretty; max-width: 34em;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.hero-caption { margin: 0; font-size: var(--web-caption); line-height: var(--lh-caption); color: var(--text-tertiary); }
.hero-panel {
  background: linear-gradient(180deg, var(--navy-700), var(--navy-950));
  border-radius: var(--radius-xl); padding: clamp(20px, 3cqw, 40px);
  box-shadow: var(--shadow-3);
}

/* Feature cards */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--web-gutter); }
.feature-card {
  display: flex; flex-direction: column; gap: 16px; padding: 20px;
  background: var(--surface-raised); border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-1); border-radius: var(--radius-md);
}
.feature-card .feature-art {
  background: var(--surface-secondary); border-radius: var(--radius-sm);
  display: grid; place-items: center; padding: 12px 0; min-height: 144px;
}
.feature-card h3 { margin: 0; font-size: var(--web-h4); line-height: 1.3; font-weight: 600; }
.feature-card p { margin: 0; color: var(--text-secondary); font-size: var(--web-callout); text-wrap: pretty; }

/* Menu bar clock illustration */
.menubar-strip {
  width: 230px; height: 26px; border-radius: 6px 6px 0 0;
  background: var(--surface-raised); border: 1px solid var(--border-subtle); border-bottom: none;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 0 10px;
  font-family: var(--font-app); font-size: 11px; color: var(--text-primary);
}
.mb-glyph { width: 14px; height: 14px; display: block; fill: currentColor; }
.mb-wifi { width: 14px; height: 9px; border: 1.5px solid currentColor; border-radius: 2px; box-sizing: border-box; }

/* Accommodation section */
.prose-narrow { max-width: var(--web-container-narrow); display: flex; flex-direction: column; gap: clamp(16px, 2cqw, 24px); }
.prose-narrow p { margin: 0; text-wrap: pretty; }
.prose-narrow > p:first-of-type { font-size: var(--web-body-lg); }
.prose-narrow > p:last-of-type { font-size: var(--web-body-lg); color: var(--text-secondary); }

/* Pricing */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--web-gutter); max-width: 760px; }
.plan-card {
  position: relative; padding: 20px; background: var(--surface-raised);
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-1);
  border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 12px;
}
.plan-card--recommended { border-color: var(--navy-500); box-shadow: var(--shadow-2); }
.plan-badge {
  position: absolute; top: -10px; left: 20px; padding: 2px 8px;
  border-radius: var(--radius-pill); background: var(--action-primary);
  color: var(--action-primary-text); font-size: 11px; font-weight: 600;
}
.plan-name { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.plan-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-price .amount { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.plan-price .was { font-size: 18px; color: var(--text-tertiary); text-decoration: line-through; }
.plan-price .period { font-size: 13px; color: var(--text-secondary); }
.plan-line { font-size: 13px; font-weight: 500; color: var(--accent-portal-text); }
.plan-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.plan-list li { display: flex; gap: 8px; }
.plan-list .tick { color: var(--status-success); }
.pricing-note { margin: 0; font-size: var(--web-callout); color: var(--text-secondary); }

/* Privacy strip */
.privacy-strip { margin-top: clamp(64px, 6.7cqw, 96px); background: var(--surface-secondary); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }
.privacy-strip-inner { max-width: var(--web-container); margin: 0 auto; padding: clamp(32px, 3.3cqw, 48px) clamp(16px, 2.2cqw, 24px); display: flex; flex-direction: column; gap: 20px; }
.privacy-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: var(--web-gutter); }
.privacy-facts div { font-size: var(--web-h4); font-weight: 600; line-height: 1.3; padding-left: 12px; border-left: 2px solid var(--navy-500); }
.privacy-strip p { margin: 0; font-size: var(--web-callout); color: var(--text-secondary); text-wrap: pretty; }
.privacy-strip a { text-decoration: underline; text-underline-offset: 3px; }

/* Footer */
.site-footer {
  max-width: var(--web-container); margin: 0 auto; width: 100%; box-sizing: border-box;
  padding: clamp(24px, 3cqw, 40px) clamp(16px, 2.2cqw, 24px) clamp(32px, 3.3cqw, 48px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px clamp(16px, 2cqw, 28px);
  font-size: var(--web-caption); color: var(--text-tertiary);
}
.site-footer a { color: var(--text-secondary); }
.site-footer .spacer { flex: 1; }

/* ---- Crossing scene (hero animation + static "wall" diagram) ---- */
.crossing {
  position: relative; width: 100%; aspect-ratio: 4072 / 1882; font-family: var(--font-web);
}
.crossing .panel {
  position: absolute; border-radius: clamp(4px, 1.4%, 10px); box-sizing: border-box;
  background: #fff; box-shadow: 0 2px 6px rgba(10, 24, 48, 0.35);
}
.crossing .laptop { left: 0%; top: 47.82%; width: 37.13%; height: 52.18%; }
.crossing .monitor { left: 37.13%; top: 0%; width: 62.87%; height: 76.51%; }
.crossing .bar {
  position: absolute; left: 37.13%; top: 53.03%; height: 46.97%;
  width: clamp(4px, 1.1%, 8px); transform: translateX(-50%);
  border-radius: var(--radius-pill); background: var(--accent-portal); box-shadow: var(--shadow-portal);
  opacity: 0;
}
.crossing .cursor {
  position: absolute; width: 14px; height: 22px; background: #000;
  clip-path: polygon(0 0, 100% 62%, 55% 68%, 75% 100%, 60% 100%, 42% 72%, 0 95%);
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff);
  opacity: 0;
}
.crossing--animate .cursor-a { animation: cc-cur-a 4s linear infinite; }
.crossing--animate .cursor-b { animation: cc-cur-b 4s linear infinite; }
.crossing--animate .bar { animation: cc-bar 4s linear infinite; }

@keyframes cc-cur-a {
  0% { left: 8%; top: 88.2%; opacity: 1; animation-timing-function: cubic-bezier(0.1, 0.7, 0.3, 1); }
  24% { left: 37.13%; } 26% { left: 36.6%; } 28% { left: 37.13%; } 30% { left: 36.7%; }
  32% { left: 37.13%; } 34% { left: 36.75%; } 36% { left: 37.13%; }
  50% { left: 37.13%; top: 88.2%; animation-timing-function: cubic-bezier(0.9, 0, 0.1, 1); }
  52.5% { left: 38.6%; top: 64.72%; }
  93% { left: 38.6%; top: 64.72%; opacity: 1; }
  96% { opacity: 0; left: 38.6%; top: 64.72%; }
  96.1% { left: 8%; top: 88.2%; opacity: 0; }
  100% { left: 8%; top: 88.2%; opacity: 1; }
}
@keyframes cc-cur-b { 0%, 100% { opacity: 0; } }
@keyframes cc-bar { 0%, 47% { opacity: 0; } 50%, 55% { opacity: 1; } 70%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .crossing--animate .cursor-a { animation: cc-cur-a-rm 4s linear infinite; }
  .crossing--animate .cursor-b { animation: cc-cur-b-rm 4s linear infinite; }
  .crossing--animate .bar { animation: cc-bar-rm 4s linear infinite; }
  @keyframes cc-cur-a-rm {
    0% { left: 37.13%; top: 88.2%; opacity: 1; } 45% { opacity: 1; } 50% { opacity: 0; }
    92% { opacity: 0; } 97% { opacity: 1; } 100% { left: 37.13%; top: 88.2%; opacity: 1; }
  }
  @keyframes cc-cur-b-rm {
    0% { left: 38.6%; top: 64.72%; opacity: 0; } 45% { opacity: 0; } 50% { opacity: 1; }
    92% { opacity: 1; } 97% { opacity: 0; } 100% { left: 38.6%; top: 64.72%; opacity: 0; }
  }
  @keyframes cc-bar-rm { 0%, 40% { opacity: 0; } 45%, 60% { opacity: 1; } 75%, 100% { opacity: 0; } }
}

/* Static "wall" diagram (the problem section) */
.crossing--diagram .panel { background: var(--navy-800); border: none; box-shadow: none; }
.crossing--diagram .guide {
  position: absolute; left: 37.13%; width: clamp(5px, 1.1%, 8px); transform: translateX(-50%);
  border-radius: var(--radius-pill);
}
.crossing--diagram .guide--cross { top: 47.82%; height: 28.69%; background: var(--navy-500); }
.crossing--diagram .guide--stop {
  top: 76.51%; height: 23.49%;
  background: repeating-linear-gradient(180deg, var(--grey-400) 0 3px, transparent 3px 6px);
}
.crossing--diagram .guide-label {
  position: absolute; left: 41.5%; right: 4%; display: flex; align-items: center; gap: 8px;
  font-size: clamp(11px, 1.6cqw, 15px); font-weight: 500; line-height: 1.3; white-space: nowrap;
}
.crossing--diagram .guide-label--cross { top: 58%; color: var(--text-primary); }
.crossing--diagram .guide-label--stop { top: 86%; color: var(--text-secondary); }
.crossing--diagram .guide-label span:first-child { width: clamp(14px, 3%, 36px); height: 1px; background: var(--grey-400); }
.crossing--diagram .guide-label--cross span:first-child { background: var(--navy-500); }
.diagram-well {
  background: var(--surface-secondary); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: clamp(20px, 3cqw, 48px);
}

/* ---- Display arrangement diagrams (features + support corner illustration) ---- */
.display-arrangement { position: relative; }
.display-arrangement .display {
  position: absolute; border-radius: 6px; box-sizing: border-box;
  background: var(--navy-800); border: none;
  display: grid; place-items: center; color: var(--text-tertiary); font-family: var(--font-app); font-size: 11px;
}
.display-arrangement .portal {
  position: absolute; border-radius: var(--radius-pill);
  background: var(--accent-portal); box-shadow: var(--shadow-portal);
}
.arrangement-well {
  background: var(--surface-secondary); border-radius: var(--radius-sm);
  display: grid; place-items: center; padding: 12px 0;
}

/* Screenshot placeholder — swap for a real image once C4 assets exist */
.screenshot-slot {
  width: 100%; height: 280px; border-radius: 10px;
  background: var(--surface-secondary); border: 1px dashed var(--border-strong);
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 16px; box-sizing: border-box; color: var(--text-tertiary);
  font-size: 13px; line-height: 1.5;
}

/* Callout (Support page) */
.callout {
  display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); color: var(--text-primary);
  font-family: var(--font-web); font-size: 14px; line-height: 1.55;
}
.callout::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; }
.callout-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.callout--warning { background: var(--status-warning-bg); }
.callout--warning::before { background: var(--status-warning); }
.callout--warning .callout-title { color: var(--status-warning); }
.callout--note { background: var(--status-info-bg); }
.callout--note::before { background: var(--status-info); }
.callout--note .callout-title { color: var(--status-info); }

/* Support layout */
.support-layout {
  max-width: var(--web-container); margin: 0 auto;
  padding: clamp(32px, 4cqw, 56px) clamp(16px, 2.2cqw, 24px) clamp(64px, 6.7cqw, 96px);
  display: flex; flex-wrap: wrap; gap: clamp(32px, 4cqw, 64px); align-items: flex-start;
}
.support-toc {
  position: sticky; top: 24px; flex: 0 0 240px;
  display: flex; flex-direction: column; gap: 2px; font-size: 14px; padding-top: 88px;
}
.support-toc-label {
  font-size: var(--web-overline); letter-spacing: var(--ls-overline); text-transform: uppercase;
  color: var(--text-tertiary); font-weight: 600; margin-bottom: 8px;
}
.support-toc a { color: var(--text-secondary); padding: 6px 10px; border-radius: var(--radius-sm); }
.support-toc a:hover { background: var(--action-quiet-hover); color: var(--text-primary); }
@media (max-width: 860px) { .support-toc { display: none; } }
.support-main {
  flex: 1 1 min(100%, 480px); min-width: 0; max-width: var(--web-container-narrow);
  display: flex; flex-direction: column; gap: clamp(40px, 4.5cqw, 64px);
}
.support-main h1 { margin: 0; font-size: clamp(2rem, 3.2cqw, 2.75rem); line-height: var(--lh-heading); letter-spacing: var(--ls-display); font-weight: 700; }
.support-intro { margin: 0; font-size: var(--web-body-lg); color: var(--text-secondary); text-wrap: pretty; }
.support-section { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 24px; }
.support-section h2 { margin: 0; font-size: var(--web-h3); line-height: 1.2; letter-spacing: var(--ls-heading); font-weight: 600; }
.support-section p { margin: 0; text-wrap: pretty; }
.support-section p.muted { color: var(--text-secondary); }

/* Privacy page */
.privacy-main {
  max-width: var(--web-container-narrow); margin: 0 auto;
  padding: clamp(32px, 4cqw, 56px) clamp(16px, 2.2cqw, 24px) clamp(64px, 6.7cqw, 96px);
  display: flex; flex-direction: column; gap: clamp(28px, 3cqw, 40px);
}
.privacy-main a { text-decoration: underline; text-underline-offset: 3px; }
.privacy-updated {
  margin: 0; font-size: var(--web-overline); letter-spacing: var(--ls-overline); text-transform: uppercase;
  color: var(--text-tertiary); font-weight: 600;
}
.privacy-main h1 { margin: 0; font-size: clamp(2rem, 3.2cqw, 2.75rem); line-height: var(--lh-heading); letter-spacing: var(--ls-display); font-weight: 700; text-wrap: pretty; }
.privacy-lede { margin: 0; font-size: var(--web-body-lg); text-wrap: pretty; }
.privacy-main section { display: flex; flex-direction: column; gap: 12px; }
.privacy-main h2 { margin: 0; font-size: var(--web-h3); line-height: 1.2; letter-spacing: var(--ls-heading); font-weight: 600; }
.privacy-main p { margin: 0; text-wrap: pretty; }

/* Thanks page */
.thanks-main {
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: clamp(24px, 3cqw, 32px);
  padding: clamp(24px, 4cqw, 48px) clamp(16px, 2.2cqw, 24px) clamp(48px, 6cqw, 96px);
}
.thanks-main h1 { margin: 0; font-size: clamp(2.25rem, 5cqw, 3.5rem); line-height: var(--lh-display); letter-spacing: var(--ls-display); font-weight: 700; }
.thanks-copy { display: flex; flex-direction: column; gap: 16px; max-width: 34em; }
.thanks-copy p { margin: 0; font-size: var(--web-body-lg); color: var(--text-secondary); text-wrap: pretty; }
.thanks-figure { margin: 0; width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.thanks-menubar {
  width: 100%; height: 32px; border-radius: var(--radius-sm); background: var(--surface-tertiary);
  border: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: flex-end;
  gap: 16px; padding: 0 14px; box-sizing: border-box; font-family: var(--font-app); font-size: 13px; color: var(--text-primary);
}
.thanks-menubar-icon {
  display: grid; place-items: center; width: 26px; height: 16px; box-sizing: content-box;
  border-radius: 4px; background: var(--action-quiet-pressed);
}
.thanks-menubar-icon .mb-glyph { width: 14px; height: 14px; fill: currentColor; }
.thanks-figcaption { display: flex; align-items: center; gap: 8px; font-size: var(--web-caption); color: var(--text-secondary); margin-right: 106px; }
.thanks-figcaption span { width: 1px; height: 14px; background: var(--border-strong); }
.thanks-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; font-size: var(--web-callout); }
.thanks-links a { text-decoration: underline; text-underline-offset: 3px; }
