@import './tokens.css';

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background-color: #002C73; }

body {
    font-family: var(--font-display), sans-serif;
    background: var(--color-royal-blue-900);
    color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Utilities
   ============================================================ */
.container { max-width: 1228px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px); }
.text-center { text-align: center; }
.blue { color: var(--color-sky-blue-500); }
.italic { font-style: italic; }

/* ============================================================
   Page header wrapper (nav + hero = 100vh)
   ============================================================ */
.page-header {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Nav
   ============================================================ */
.nav {
    display: flex;
    align-items: center;
    background: var(--color-royal-blue-900);
    padding: 40px 0;
}

.nav-inner {
    width: 100%;
    max-width: 1228px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 64px);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img { display: block; height: 34px; }

.btn-contact {
    background: var(--color-red-500);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 18px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.07em;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-contact:hover { background: var(--color-red-700); }

/* ============================================================
   Hero  (Section 1)
   ============================================================ */
.hero {
    flex: 1;
    background: var(--color-royal-blue-900);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Text row */
.hero-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 80px;
    padding: 40px clamp(20px, 5vw, 64px) 0;
    max-width: 1228px;
    width: 100%;
    margin: 0 auto;
    flex-shrink: 0;
}

.hero-heading {
    font-size: clamp(36px, 5.5vw, 64px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.025em;
    flex: 0 0 auto;
    white-space: nowrap;
}

.hero-aside {
    flex: 1;
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.hero-aside-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
}

.hero-aside p {
    font-size: 22px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    max-width: 400px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    background: var(--color-royal-blue-500);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 8px 18px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.07em;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--color-royal-blue-700); transform: translateY(-1px); }

/* Device images */
.hero-devices {
    position: absolute;
    inset: 0 0 0 0;
    z-index: 1;
    pointer-events: none;
}

/* Bottom fade overlay — uses background colour to create the illusion of fading */
.hero-devices::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to top, var(--color-royal-blue-900) 0%, transparent 100%);
    z-index: 5;
    pointer-events: none;
}

.device-web {
    position: absolute;
    top: 380px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 128px);
    display: block;
}

.device-phone {
    position: absolute;
    top: 280px;
    left: 60%;
    width: 20%;
    display: block;
    z-index: 2;
}

/* ============================================================
   Shared section styles
   ============================================================ */
.section {
    min-height: 100vh;
    background: var(--color-royal-blue-900);
    display: flex;
    align-items: center;
}

.section h2 {
    font-size: clamp(36px, 3.8vw, 56px);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 24px;
    line-height: 1.1;
}

.section-sub {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto 56px;
}
.section-sub.left { margin-left: 0; margin-bottom: 40px; }

/* ============================================================
   Features  (Section 2)
   ============================================================ */
.section-features .container { width: 100%; }
.section-features .section-sub { margin-bottom: 96px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 48px;
    max-width: 900px;
    margin: 0 auto;
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    cursor: pointer;
}

.feature-icon-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 4px;
    transition: transform 0.25s ease, filter 0.25s ease;
}
.feature-card:hover .feature-icon-img {
    transform: translateY(-6px) scale(1.08);
    filter: drop-shadow(0 8px 16px rgba(0, 170, 255, 0.35));
}

.feature-card h3 { font-size: 18px; font-weight: 700; }
.feature-card p  { font-size: 15px; color: rgba(255,255,255,0.65); line-height: 1.65; }

/* ============================================================
   Programs  (Section 3)
   ============================================================ */
.section-programs .container { width: 100%; }
.section-programs .section-sub { margin-bottom: 96px; }

.programs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.program-card {
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: var(--radius-lg);
    padding: 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}
.program-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 170, 255, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 170, 255, 0.2);
}
.program-card h3 { font-size: 18px; font-weight: 700; }
.program-card p  { font-size: 15px; color: rgba(255,255,255,0.65); line-height: 1.7; flex: 1; }

.program-link {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--color-sky-blue-400);
    text-decoration: none;
    margin-top: 8px;
    display: inline-block;
    transition: color 0.15s;
}
.program-link:hover { color: var(--color-sky-blue-500); }

/* ============================================================
   Product  (Section 4)
   ============================================================ */
.section-product {
    height: 100vh;
    min-height: unset;
    justify-content: center;
}

.section-product .container { width: 100%; }

.section-product .section-sub { margin-bottom: 56px; }

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    text-align: left;
}

.product-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.product-list li {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.product-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-icon img {
    width: 48px;
    height: 48px;
    filter: invert(55%) sepia(80%) saturate(600%) hue-rotate(180deg) brightness(1.1);
}

.product-list strong { display: block; font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.product-list span   { font-size: 15px; color: rgba(255,255,255,0.65); line-height: 1.65; white-space: nowrap; }

.product-right { display: flex; align-items: center; justify-content: center; }

.iconset-img { width: 100%; max-width: 260px; mix-blend-mode: screen; }

/* ============================================================
   Beta Sign-Up  (Section 4.5)
   ============================================================ */
.section-beta {
    padding: 120px 0;
}
.section-beta .container { width: 100%; }
.section-beta .section-sub { margin-bottom: 56px; }

.beta-form-wrap {
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-xl);
    padding: 56px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.beta-form-wrap:hover {
    border-color: rgba(255,255,255,0.35);
    box-shadow: 0 0 60px rgba(0, 130, 255, 0.18);
}

.beta-form-header {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.beta-form-header h2 {
    font-size: clamp(22px, 2.2vw, 32px);
    margin-bottom: 10px;
}

.beta-form-header .section-sub {
    font-size: 16px;
    margin-bottom: 0;
}

.beta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 32px;
    text-align: left;
    margin-bottom: 24px;
}

.beta-consent {
    text-align: left;
    margin-bottom: 28px;
    padding: 20px 0 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    line-height: 1.5;
}

.consent-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--color-sky-blue-500);
    cursor: pointer;
}

.beta-submit {
    max-width: 320px;
    margin: 0 auto;
    display: block;
}

.req { color: var(--color-red-500); }

.form-full { grid-column: 1 / -1; }

.form-group textarea {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-family: var(--font-display);
    font-size: 15px;
    color: #fff;
    outline: none;
    width: 100%;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.15s;
}
.form-group textarea::placeholder { color: rgba(255,255,255,0.28); }
.form-group textarea:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.38);
}
.form-group textarea:focus { border-color: var(--color-sky-blue-500); }

/* ============================================================
   Contact / Inquiries  (Section 4.6)
   ============================================================ */
.section-contact { padding: 0 0 120px; }
.section-contact .container { width: 100%; }

/* ============================================================
   CTA  (Section 5)
   ============================================================ */
.section-cta {
    display: block;
    max-width: 1228px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 64px) clamp(20px, 5vw, 64px) clamp(64px, 8vw, 120px);
}
.cta-banner  { width: 100%; display: block; border-radius: 8px; }

/* ============================================================
   Footer
   ============================================================ */
.footer { background: #040C1E; padding: 48px 0 24px; }

.footer-inner {
    max-width: 1228px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 64px) 32px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
}

.footer-right { justify-self: end; }

.footer-left { display: flex; flex-direction: column; gap: 10px; }
.footer-logo-link { display: inline-block; }
.footer-logo { height: 24px; display: block; }

.footer-links a {
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-links a:hover { color: #fff; }

.footer-nav {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 12px 32px;
    align-content: start;
}
.footer-nav a {
    font-size: 14px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-nav a:hover { color: #fff; }

.footer-social { display: flex; gap: 14px; }
.footer-social a { color: rgba(255,255,255,0.5); display: flex; transition: color 0.15s; }
.footer-social a:hover { color: #fff; }

.footer-right { text-align: right; display: flex; flex-direction: column; gap: 6px; }
.footer-right p { font-size: 14px; color: rgba(255,255,255,0.5); }
.footer-canada { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.leaf-icon { height: 16px; width: auto; }

.footer-bottom {
    max-width: 1228px;
    margin: 0 auto;
    padding: 20px clamp(20px, 5vw, 64px) 0;
    border-top: 1px solid rgba(255,255,255,0.07);
}
.footer-bottom p { font-size: 12px; color: rgba(255,255,255,0.28); }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
    background: #002060;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 460px;
    width: 100%;
    position: relative;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(16px);
    transition: transform 0.2s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }

.modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none; border: none;
    color: rgba(255,255,255,0.35);
    font-size: 26px; line-height: 1;
    cursor: pointer; padding: 4px 6px;
    transition: color 0.15s;
}
.modal-close:hover { color: #fff; }

.modal-header {
    display: flex; flex-direction: column;
    align-items: center; gap: 10px;
    text-align: center; margin-bottom: 28px;
}
.modal-header h2 { font-size: 26px; font-weight: 800; }
.modal-header p  { font-size: 14px; color: rgba(255,255,255,0.58); }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-group label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.8); }

.form-group input,
.form-group select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-family: var(--font-display);
    font-size: 15px;
    color: #fff;
    outline: none;
    width: 100%;
    transition: border-color 0.15s;
    appearance: none;
}
.form-group input::placeholder { color: rgba(255,255,255,0.28); }
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.form-group select option { background: #002060; }
.form-group input:hover,
.form-group select:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.38);
}
.form-group input:focus,
.form-group select:focus { border-color: var(--color-sky-blue-500); }

.btn-submit {
    width: 100%;
    background: var(--color-royal-blue-500);
    color: #fff; border: none;
    border-radius: var(--radius-md);
    padding: 15px;
    font-family: var(--font-display);
    font-size: 15px; font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    margin-top: 6px;
}
.btn-submit:hover:not(:disabled) { background: var(--color-royal-blue-700); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.55; cursor: not-allowed; }

.form-error {
    margin-top: 14px; padding: 14px;
    background: rgba(255,48,3,0.1);
    border: 1px solid rgba(255,48,3,0.25);
    border-radius: var(--radius-md);
    font-size: 13px; color: var(--color-red-400);
    text-align: center; line-height: 1.5;
}
.form-error a { color: var(--color-red-400); }

.form-success {
    display: flex; flex-direction: column;
    align-items: center; gap: 14px;
    padding: 20px 0; text-align: center;
}
.form-success h3 { font-size: 22px; font-weight: 800; }
.form-success p  { font-size: 14px; color: rgba(255,255,255,0.6); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
    .product-layout { grid-template-columns: 1fr; }
    .product-right { display: none; }
}

@media (max-width: 768px) {
    .nav { padding: 20px 0; }
    .nav-logo img { height: 28px; }

    .hero-top { flex-direction: column; padding-top: 32px; gap: 20px; }
    .hero-heading { white-space: normal; }
    .hero-aside { align-items: flex-start; }
    .hero-aside p, .section-sub { font-size: 18px; }

    .device-web  { width: 90%; }
    .device-phone { left: 58%; width: 34%; }

    .section h2 { font-size: 32px; }
    .feature-grid { grid-template-columns: 1fr; gap: 40px; max-width: 320px; }
    .programs-grid { grid-template-columns: 1fr; }

    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .footer-right { justify-self: start; }
    .footer-right { text-align: left; }
    .footer-canada { justify-content: flex-start; }
    .footer-nav { flex-direction: row; flex-wrap: wrap; gap: 12px 24px; }

    .beta-grid { grid-template-columns: 1fr; }
    .beta-submit { max-width: 100%; }
    .beta-form-wrap { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .nav { padding: 16px 0; }
    .nav-logo img { height: 24px; }
    .btn-contact { font-size: 12px; padding: 7px 14px; }

    .hero-top { padding-top: 24px; gap: 16px; }
    .hero-aside p, .section-sub { font-size: 16px; }

    .feature-grid { max-width: 100%; }
    .program-card { padding: 24px; }
}
