/* ==========================================================================
   Tideline NZ, theme layer on top of Bootstrap 5 (dark)
   Bootstrap handles layout & components; this file supplies the palette,
   the product-page bands/device mock, and the styles that chart.js draws
   into (tide chart internals, tide list rows, port chips, demo tabs).
   ========================================================================== */

@font-face {
    font-family: 'InterVariable';
    src: url('/assets/fonts/InterVariable.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #0d1117;
    --card: rgba(26, 31, 46, 0.9);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, 0.42);
    --accent: #4a90d9;
    --accent-hover: #5b9fe4;
    --amber: #fca01a;
    --high: #69d84f;
    --low: #e06c75;

    --row-bg: rgba(26, 31, 46, 0.4);
    --row-border: rgba(255, 255, 255, 0.03);
}

/* Map the palette onto Bootstrap's dark theme tokens */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-body-font-family: 'InterVariable', system-ui, sans-serif;
    --bs-emphasis-color: #ffffff;
    --bs-emphasis-color-rgb: 255, 255, 255;
    --bs-secondary-color: var(--muted);
    --bs-tertiary-color: var(--muted);
    --bs-border-color: var(--border);
    --bs-border-color-translucent: var(--border);
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: 74, 144, 217;
    --bs-link-hover-color: var(--accent-hover);
}

body {
    font-family: 'InterVariable', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.005em;
}

/* Brand wordmark */
.logo {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--text);
}

.logo-accent {
    color: var(--accent);
}

/* Accent primary button (Bootstrap .btn-primary re-skinned) */
.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-hover);
    --bs-btn-active-bg: #3f82c8;
    --bs-btn-active-border-color: #3f82c8;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    --bs-btn-color: #ffffff;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-color: #ffffff;
    --bs-btn-disabled-color: #ffffff;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(74, 144, 217, 0.28);
}

.btn-primary:hover {
    box-shadow: 0 12px 30px rgba(74, 144, 217, 0.4);
}

/* "New on the App Store" pill, sits beside the primary hero badge */
.badge-new {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(105, 216, 79, 0.14);
    color: var(--high);
    border: 1px solid rgba(105, 216, 79, 0.35);
    font-weight: 600;
}

/* Outline / ghost button, kept for future "coming soon" store slots */
.btn-ghost {
    --bs-btn-color: var(--muted);
    --bs-btn-border-color: var(--border);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: transparent;
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-disabled-color: var(--muted);
    --bs-btn-disabled-border-color: var(--border);
    font-weight: 500;
    border: 1px solid var(--border);
}

/* Surfaces */
.surface-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.band-tint {
    background:
        radial-gradient(1200px 400px at 80% -10%, rgba(74, 144, 217, 0.14), transparent 60%),
        rgba(26, 31, 46, 0.35);
    border: 1px solid var(--border);
    border-radius: 24px;
}

.section-divider {
    border-top: 1px solid var(--border);
}

.text-muted-2 {
    color: var(--muted) !important;
}

/* Hero screenshot carousel styles live in /assets/carousel.css (shared
   with the homepage), built by /assets/carousel.js. */

/* --------------------------------------------------------------------------
   Feature highlight panels (Bootstrap "product" split look)
   -------------------------------------------------------------------------- */

.highlight-panel {
    border-radius: 22px;
    border: 1px solid var(--border);
    overflow: hidden;
    padding: 2.5rem 2rem 0;
    text-align: center;
}

.highlight-panel.panel-dark {
    background: rgba(0, 0, 0, 0.25);
}

.highlight-panel.panel-accent {
    background:
        radial-gradient(600px 240px at 50% 0%, rgba(74, 144, 217, 0.22), transparent 70%),
        rgba(26, 31, 46, 0.5);
}

.highlight-panel h2 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.highlight-glyph {
    width: 78%;
    margin: 1.75rem auto 0;
    height: 190px;
    border-radius: 20px 20px 0 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 64px;
}

/* Feature chips row */
.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--row-bg);
    border: 1px solid var(--row-border);
    border-radius: 14px;
    padding: 18px;
    font-size: 15px;
    font-weight: 500;
    height: 100%;
}

.feature i {
    color: var(--accent);
    font-size: 22px;
}

/* --------------------------------------------------------------------------
   Live demo (chart + list), chart.js draws into these
   -------------------------------------------------------------------------- */

.demo-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--row-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    max-width: 320px;
}

.demo-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.demo-tab:hover {
    color: var(--text);
}

.demo-tab.active {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.demo-panel.hidden {
    display: none;
}

#demo-chart {
    width: 100%;
    height: auto;
    display: block;
    touch-action: none;
}

/* Chart key under the demo chart */
.demo-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 18px;
    margin-top: 12px;
}

.demo-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
}

.demo-legend .legend-item .ti-fish {
    color: var(--high);
    font-size: 14px;
}

.demo-caption,
.demo-footnote {
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    margin: 14px 0 0;
}

/* Chart internals (SVG elements built in chart.js) */
.tide-curve {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
}

.tide-fill {
    fill: var(--accent);
    opacity: 0.42;   /* matches the app's wave fill exactly */
}

.tide-axis {
    stroke: var(--border);
    stroke-width: 1;
}

.tide-grid {
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 1;
}

.tide-grid-label {
    fill: rgba(255, 255, 255, 0.18);
    font-size: 9px;
    font-family: 'InterVariable', system-ui, sans-serif;
}

.tide-event-next {
    fill: var(--bg);
    stroke: var(--amber);
    stroke-width: 2.5;
}

.tide-past {
    opacity: 0.4;
}

.tide-now-halo {
    fill: #ffffff;
    opacity: 0.15;
}

.tide-now-pill {
    fill: #1e2438;
    stroke: #2a3448;
    stroke-width: 1;
}

.tide-now-pill-text {
    fill: #ffffff;
    font-size: 10px;
    font-weight: 600;
    font-family: 'InterVariable', system-ui, sans-serif;
}

.tide-now-height {
    fill: #ffffff;
    font-size: 12px;
    font-weight: 600;
    font-family: 'InterVariable', system-ui, sans-serif;
}

.tide-event-dot {
    fill: var(--bg);
    stroke: var(--accent);
    stroke-width: 2;
}

.tide-event-label {
    fill: var(--muted);
    font-size: 10px;
    font-family: 'InterVariable', system-ui, sans-serif;
}

.tide-event-label-height {
    fill: var(--text);
    font-size: 11px;
    font-weight: 600;
    font-family: 'InterVariable', system-ui, sans-serif;
}

.tide-scrubber-line {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.tide-scrubber-dot {
    fill: #ffffff;
}

.tide-scrubber-label-bg {
    fill: var(--card);
    stroke: var(--border);
    stroke-width: 1;
}

.tide-scrubber-label-text {
    fill: var(--text);
    font-size: 12px;
    font-weight: 600;
    font-family: 'InterVariable', system-ui, sans-serif;
}

/* Tide list view (built in chart.js) */
.tide-list {
    display: flex;
    flex-direction: column;
}

.tide-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px;
    border-bottom: 1px solid var(--row-border);
}

.tide-row:last-child {
    border-bottom: none;
}

.tide-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tide-row-type {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
}

.tide-row-type-hw {
    background: rgba(105, 216, 79, 0.12);
    color: var(--high);
}

.tide-row-type-lw {
    background: rgba(224, 108, 117, 0.12);
    color: var(--low);
}

.tide-row-time {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.tide-row-height {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.tide-row-height-unit {
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
    margin-left: 2px;
}

/* --------------------------------------------------------------------------
   Port coverage grid (built in chart.js)
   -------------------------------------------------------------------------- */

.port-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.port-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--row-bg);
    border: 1px solid var(--row-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 500;
}

.port-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

.port-chip-count {
    font-size: 11px;
    color: var(--muted);
    margin-left: auto;
}

/* Expandable port groups (ports.json variant of the grid) */
button.port-group-header {
    cursor: pointer;
    color: var(--text);
    text-align: left;
    font-family: inherit;
    transition: border-color 0.15s;
}

button.port-group-header:hover {
    border-color: var(--accent);
}

button.port-group-header .port-chip-count {
    margin-left: auto;
}

.port-chevron {
    color: var(--muted);
    font-size: 15px;
    transition: transform 0.2s;
}

.port-group-header.open .port-chevron {
    transform: rotate(180deg);
}

.port-secondaries {
    display: none;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(26, 31, 46, 0.25);
    border: 1px solid var(--row-border);
    border-radius: 12px;
}

.port-secondaries.open {
    display: flex;
}

.port-sec {
    font-size: 12.5px;
    color: var(--muted);
    background: var(--row-bg);
    border: 1px solid var(--row-border);
    border-radius: 8px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* "Now" marker (SVG elements built in chart.js, NZ time) */
.tide-now-line {
    stroke: rgba(255, 255, 255, 0.35);
    stroke-width: 1.5;
    stroke-dasharray: 3 4;
}

.tide-now-dot {
    fill: #ffffff;
    stroke: var(--accent);
    stroke-width: 2;
}

.tide-now-label {
    fill: var(--text);
    font-size: 11px;
    font-weight: 600;
    font-family: 'InterVariable', system-ui, sans-serif;
}

/* Launch threshold line (SVG elements built in chart.js) */
.tide-threshold {
    stroke: var(--amber);
    stroke-width: 1.5;
    stroke-dasharray: 6 5;
    opacity: 0.55;
}

.tide-threshold-label {
    fill: var(--amber);
    opacity: 0.75;
    font-size: 10px;
    font-family: 'InterVariable', system-ui, sans-serif;
}

/* Bite-time overlay (SVG elements built in chart.js) */
.tide-bite-bar {
    fill: var(--high);
}

.tide-bite-fish path {
    fill: none;
    stroke: var(--high);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Screenshot strip (real app screenshots)
   -------------------------------------------------------------------------- */

.screenshot-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
}

.screenshot-strip figure {
    margin: 0;
    text-align: center;
}

.screenshot-strip img {
    width: 100%;
    height: auto;
    border-radius: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.screenshot-strip figcaption {
    color: var(--muted);
    font-size: 13px;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Pricing + footer
   -------------------------------------------------------------------------- */

.price {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.price-currency {
    font-size: 20px;
    color: var(--muted);
    font-weight: 500;
}

.disclaimer {
    max-width: 720px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
}
