/* =========================================
   PUBLIC HOMEPAGE (index.html, en/index.html)

   The introduction for visitors who are not signed in. The app itself
   (leiktiminn.html) and its sign-in screen are unchanged; the buttons
   here only open them. Colours are the app's (css/lt-app.css, :root).

   No outlines: areas are told apart by slightly different dark
   backgrounds and by spacing. Screenshots are shown at most at their
   own size (never enlarged).
========================================= */

:root {
    color-scheme: dark;
    --bg: #0b0c0e;             /* page */
    --band: #15181c;           /* the features and About: one step lighter than the page */
    --surface: #1b1e22;        /* buttons, cards, tabs */
    --surface-hover: #23272c;
    --shot-surface: #1f2328;   /* behind the feature screenshots */
    --well: #0e1012;           /* the tab bar inside a band */
    --text: #eceeec;
    --text-2: #b3b9b5;
    --text-3: #868e8a;
    --accent: #d1fa17;
    --accent-hover: #dcfb4f;
    --accent-ink: #0d1a11;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --wrap: 1280px;
    --gutter: clamp(20px, 4.2vw, 72px);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

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

.home-wrap {
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 20;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: calc(10px + var(--safe-top));
}

/* ---------- header ---------- */

.home-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-top: var(--safe-top);
    background: var(--bg);
}

.home-header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 68px;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    color: var(--text);
    text-decoration: none;
}

.home-brand img {
    width: auto;
    height: 28px;
    aspect-ratio: 651.55 / 636.94;
}

.home-brand span {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.home-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.home-nav a {
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-2);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.home-nav a:hover {
    color: var(--text);
}

.home-nav .home-lang {
    color: var(--text-3);
}

.home-nav-sep {
    width: 14px;
}

.home-nav .home-nav-signup {
    margin-left: 6px;
    padding: 8px 14px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700;
}

.home-nav .home-nav-signup:hover {
    background: var(--accent-hover);
    color: var(--accent-ink);
}

/* ---------- buttons ---------- */

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-quiet {
    background: var(--surface);
    color: var(--text);
}

.btn-quiet:hover {
    background: var(--surface-hover);
}

/* ---------- hero ---------- */

.home-hero {
    padding: clamp(56px, 8vw, 128px) 0 clamp(56px, 7vw, 112px);
}

.home-hero-text {
    max-width: 680px;
}

.home-hero h1 {
    margin: 0;
    font-size: clamp(38px, 4.8vw, 68px);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.04;
}

.home-hero h1 .lime {
    color: var(--accent);
}

.home-lead {
    max-width: 580px;
    margin: 22px 0 32px;
    color: var(--text-2);
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.6;
}

/* ---------- Garmin ---------- */

.text-link {
    color: var(--accent);
    font-weight: 650;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- footer ---------- */

.home-footer {
    padding: 36px 0 calc(40px + var(--safe-bottom));
    color: var(--text-3);
    font-size: 14px;
}

.home-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
}

.home-footer-inner .home-brand {
    margin-right: auto;
}

.home-footer-inner .home-brand img {
    height: 22px;
}

.home-footer-inner .home-brand span {
    font-size: 15px;
}

.home-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.home-footer a {
    color: var(--text-2);
    text-decoration: none;
}

.home-footer a:hover {
    color: var(--text);
}

/* ---------- preview deployments: sign-in is turned off ---------- */

.preview-note {
    display: none;
}

.lt-preview .preview-note {
    display: block;
    margin: 0;
    padding: 10px var(--gutter);
    background: #2a2410;
    color: #f1e2a6;
    font-size: 14px;
    text-align: center;
}

.preview-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--safe-bottom));
    z-index: 30;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    transform: translateX(-50%);
    border-radius: 12px;
    background: var(--surface-hover);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-size: 15px;
}

/* ---------- laptop / tablet ---------- */

@media (max-width: 960px) {

    .home-nav .home-nav-secondary,
    .home-nav-sep {
        display: none;
    }
}

/* ---------- phone ---------- */

@media (max-width: 700px) {
    .home-header-inner {
        height: 58px;
        gap: 10px;
    }

    .home-nav a {
        padding: 8px 8px;
        font-size: 14px;
    }

    .home-nav .home-nav-signup {
        display: none;
    }

    .home-lead {
        margin: 16px 0 24px;
    }

    .home-actions .btn {
        flex: 1 1 160px;
    }

    /* phones: a little less padding around the desktop screenshots */

    .home-footer-inner .home-brand {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .home-nav .home-lang {
        display: none;
    }
}

/* =========================================
   PRODUCT LAUNCH (LAYOUT "launch"): hero, iPhone, Garmin
   The devices are the visuals: real iPhone screens in their real device
   frames, the real Garmin watch photography. Centred introductions over
   a product stage; near-black tones step slightly between sections; no
   borders, glows or gradients; one soft shadow under the phones.
========================================= */

.home-hero {
    padding: clamp(72px, 10vw, 168px) 0 clamp(72px, 9vw, 144px);
}

.home-hero-text {
    max-width: 960px;
}

.home-hero h1 {
    font-size: clamp(48px, 7.2vw, 108px);
    line-height: 1;
    letter-spacing: -0.035em;
}

.home-lead {
    max-width: 600px;
    margin: 28px 0 36px;
    font-size: clamp(18px, 1.55vw, 21px);
}

.showcase {
    padding: clamp(80px, 9vw, 144px) 0 clamp(72px, 8vw, 128px);
    overflow: hidden;
}

.showcase-garmin {
    background: var(--bg);
}

.showcase-intro {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.showcase-intro h2 {
    margin: 0;
    font-size: clamp(38px, 5vw, 72px);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.03;
}

.showcase-lead {
    max-width: 560px;
    margin: 22px auto 0;
    color: var(--text-2);
    font-size: clamp(17px, 1.45vw, 20px);
    line-height: 1.55;
}

.showcase-actions {
    justify-content: center;
    align-items: center;
    gap: 14px 26px;
    margin-top: 30px;
}

/* two iPhones: the match in front, played matches slightly behind */
.iphone-stage {
    position: relative;
    width: min(640px, 100%);
    aspect-ratio: 640 / 730;
    margin: clamp(48px, 6vw, 80px) auto 0;
}

.iphone {
    position: absolute;
    height: auto;
    filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.5));
}

.iphone-front {
    z-index: 2;
    top: 0;
    right: 4%;
    width: 53%;
}

.iphone-back {
    z-index: 1;
    top: 9%;
    left: 4%;
    width: 46%;
}

/* the watches: one wide photograph, its edges already feathered */
.garmin-stage {
    max-width: 1240px;
    margin: clamp(32px, 4.5vw, 64px) auto 0;
}

.garmin-stage img {
    width: 100%;
}

/* footer: one line about Leiktíminn (the header's About link) */
.home-footer {
    padding-top: clamp(40px, 5vw, 64px);
    background: #101215;
}

.home-footer-inner {
    align-items: flex-start;
    gap: 24px 48px;
}

.home-footer-about {
    margin-right: auto;
}

.home-footer-about p {
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--text-3);
    font-size: 14.5px;
    line-height: 1.6;
}

.home-footer nav {
    padding-top: 4px;
}

@media (max-width: 700px) {
    .home-hero {
        padding: 56px 0 64px;
    }

    .showcase {
        padding: 72px 0 64px;
    }

    .showcase-intro {
        text-align: left;
    }

    .showcase-lead {
        margin-left: 0;
    }

    .showcase-actions {
        justify-content: flex-start;
    }

    /* phones: bigger devices, more overlap, so the screens stay readable */
    .iphone-stage {
        width: 100%;
        aspect-ratio: 1 / 1.55;
        margin-top: 40px;
    }

    .iphone-front {
        right: 0;
        width: 70%;
    }

    .iphone-back {
        left: 0;
        top: 7%;
        width: 56%;
    }

    .garmin-stage {
        margin-left: calc(-1 * var(--gutter));
        margin-right: calc(-1 * var(--gutter));
    }
}

.btn-small {
    min-height: 40px;
    margin-top: 18px;
    padding: 0 18px;
    font-size: 15px;
}

.home-footer .btn-primary,
.home-footer .btn-primary:hover {
    color: var(--accent-ink);
}

/* iPhone stage: a soft, neutral studio light behind the phones (in the
   spirit of the Garmin photograph's background), so the devices sit in
   a space rather than float on black. One quiet light, no colour. */
.iphone-stage::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: -45%;
    right: -45%;
    top: -12%;
    bottom: -18%;
    pointer-events: none;
    background:
        radial-gradient(ellipse 42% 46% at 50% 46%, rgba(170, 180, 190, 0.14), rgba(170, 180, 190, 0.045) 55%, transparent 78%),
        radial-gradient(ellipse 34% 12% at 50% 92%, rgba(170, 180, 190, 0.06), transparent 75%);
}

@media (max-width: 700px) {
    .iphone-stage::before {
        left: -30%;
        right: -30%;
    }
}

/* three iPhones (desktop): the match in the centre, in front; played
   matches left and distance and speed right, smaller, slightly behind
   and lower. Phones and small screens: two phones (see below). */
.iphone-stage-3 {
    width: min(920px, 100%);
    aspect-ratio: 920 / 720;
}

.iphone-stage-3 .iphone-center {
    z-index: 3;
    top: 0;
    left: 32%;
    right: auto;
    width: 36%;
}

.iphone-stage-3 .iphone-left {
    z-index: 2;
    top: 9%;
    left: 5%;
    width: 30%;
}

.iphone-stage-3 .iphone-right {
    z-index: 1;
    top: 9%;
    right: 5%;
    width: 30%;
}

@media (max-width: 700px) {
    .iphone-stage-3 {
        width: 100%;
        aspect-ratio: 1 / 1.55;
    }

    .iphone-stage-3 .iphone-right {
        display: none;
    }

    .iphone-stage-3 .iphone-center {
        top: 0;
        left: auto;
        right: 0;
        width: 70%;
    }

    .iphone-stage-3 .iphone-left {
        top: 7%;
        left: 0;
        width: 56%;
    }
}

/* the narrowest phones (under 375 px): a slightly smaller headline so
   the longest word ("Frammistaðan") stays inside the margins */
@media (max-width: 374px) {
    .home-hero h1 {
        font-size: 40px;
    }
}

/* =========================================
   HERO WITH THE PRODUCT: the headline, text and buttons, and the three
   real iPhone screens (the composition above) in the same section; there
   is no separate iPhone section. Desktop: side by side, both visible
   without scrolling. Tablet and phone: stacked (text, then the phones),
   with the phone layouts above unchanged.
========================================= */

.home-hero {
    overflow: hidden;              /* the light behind the phones never widens the page */
}

.home-hero-product {
    margin-top: clamp(40px, 7vw, 64px);
}

.home-hero .iphone-stage {
    margin: 0 auto;
}

@media (min-width: 961px) {
    /* the first screen below the header, its content centred in it */
    .home-hero {
        display: flex;
        align-items: center;
        min-height: calc(100svh - 68px);
        padding: clamp(32px, 3.5vw, 56px) 0;
    }

    .home-hero-grid {
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        align-items: center;
        gap: clamp(32px, 3.5vw, 64px);
    }

    .home-hero-text {
        container-type: inline-size;
    }

    /* sized by the text column, so each line of the headline ("Frammistaðan
       þín.", "Your Performance.") stays on one line at every width */
    .home-hero h1 {
        font-size: clamp(44px, 4.3vw, 64px);
        font-size: clamp(40px, 11.8cqw, 64px);
    }

    .home-lead {
        margin: 24px 0 32px;
    }

    .home-hero-product {
        margin-top: 0;
    }

    /* as large as the column allows, but never taller than the screen
       leaves below the header (header and padding: about 200 px), so
       the phones are seen whole on arrival */
    .home-hero .iphone-stage-3 {
        width: min(100%, calc((100svh - 200px) * 920 / 720));
    }

    /* the light stays behind the phones, not under the headline */
    .home-hero .iphone-stage::before {
        left: -18%;
        right: -18%;
    }
}
