/* ═══════════════════════════════════════════
   Skoledi — matches Skoledu's visual design
   Colors, layout, and feel from skoledu.dk
   ═══════════════════════════════════════════ */

:root {
    --green: #47ad86;
    --green-light: #d2ebde;
    --orange: #eb6954;
    --orange-warm: #eb9b54;
    --cream: #fff8f5;
    --white: #ffffff;
    --dark: #262626;
    --blue: #4c7aa6;
    --blue-light: #d3e9ff;
    --pink-light: #fde8e4;
    --text: #262626;
    --text-muted: #666666;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--cream);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ── Header ── */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 48px;
    background: transparent;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: 0.04em;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 36px;
    border: 2px solid var(--dark);
    border-radius: 50px;
    color: var(--dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    transition: background 0.2s, color 0.2s;
}

.login-btn:hover {
    background: var(--dark);
    color: var(--white);
}

/* ── Hero ── */

.hero {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow: hidden;
}

.hero-text {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 140px 48px 80px 80px;
    position: relative;
    z-index: 2;
}

.hero-text h1 {
    font-size: clamp(42px, 6vw, 72px);
    font-weight: 800;
    line-height: 1.05;
    color: var(--dark);
    margin-bottom: 8px;
}

.hero-squiggle {
    width: 220px;
    margin-bottom: 28px;
}

.hero-squiggle svg {
    width: 100%;
    height: auto;
}

.hero-sub {
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 400;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 40px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--orange), var(--orange-warm));
    color: var(--white);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(235, 105, 84, 0.3);
    align-self: flex-start;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(235, 105, 84, 0.4);
}

/* ── Hero visual / green blob side ── */

.hero-visual {
    flex: 0 0 55%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-blob {
    position: absolute;
    top: 0;
    right: -50px;
    width: 110%;
    height: 100%;
    z-index: 0;
}

/* ── Laptop mockup ── */

.hero-laptop {
    position: relative;
    z-index: 1;
    width: 70%;
    max-width: 440px;
    margin-top: 60px;
}

.laptop-screen {
    background: var(--white);
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    box-shadow: 0 10px 60px rgba(0,0,0,0.2);
    border: 2px solid #e0e0e0;
}

.screen-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.screen-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.screen-dot.red { background: #ff5f57; }
.screen-dot.yellow { background: #ffbd2e; }
.screen-dot.green { background: #28c840; }

.screen-url {
    margin-left: 12px;
    font-size: 10px;
    color: #999;
    flex: 1;
}

.screen-badge {
    font-size: 10px;
}

.screen-content {
    display: flex;
    min-height: 200px;
}

.screen-sidebar {
    width: 30%;
    padding: 16px 12px;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.screen-line {
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
}
.screen-line.w80 { width: 80%; }
.screen-line.w60 { width: 60%; }
.screen-line.w90 { width: 90%; }
.screen-line.w50 { width: 50%; }
.screen-line.w70 { width: 70%; }

.screen-main {
    flex: 1;
    padding: 16px;
}

.screen-formula {
    background: var(--white);
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    display: inline-block;
    margin-bottom: 14px;
    float: right;
    font-family: 'Georgia', serif;
}

.screen-figures {
    display: flex;
    gap: 10px;
    clear: both;
}

.screen-fig {
    flex: 1;
}

.fig-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.fig-svg {
    width: 100%;
    height: auto;
}

.laptop-base {
    height: 14px;
    background: linear-gradient(to bottom, #d4d4d4, #c0c0c0);
    border-radius: 0 0 4px 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.laptop-notch {
    width: 60px;
    height: 4px;
    background: #b0b0b0;
    border-radius: 0 0 4px 4px;
}

/* ── "Har skolen allerede adgang?" hint ── */

.hero-hint {
    position: absolute;
    top: 120px;
    right: 140px;
    z-index: 2;
    color: var(--white);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.hint-arrow {
    width: 40px;
    height: 50px;
    margin-top: -10px;
}

/* ── Features section ── */

.features {
    background: var(--white);
    padding: 80px 48px;
}

.features-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.feature-card {
    padding: 32px;
    border-radius: 16px;
    background: var(--cream);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Stats section ── */

.stats {
    padding: 60px 48px;
    background: var(--cream);
}

.stats-inner {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat-num {
    font-size: 42px;
    font-weight: 800;
    color: var(--green);
}

.stat-label {
    font-size: 15px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── CTA section ── */

.cta-section {
    text-align: center;
    padding: 80px 48px;
    background: var(--white);
}

.cta-section h2 {
    font-size: 36px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 12px;
}

.cta-section p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.cta-section .cta-btn {
    align-self: center;
}

/* ── Footer ── */

.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 48px 30px;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--orange);
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.footer-logo-icon {
    width: 24px;
    height: 24px;
}

.footer-desc {
    font-size: 14px;
    color: #999;
    line-height: 1.6;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 14px;
}

.footer-col a {
    display: block;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    padding: 3px 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #444;
    padding-top: 24px;
}

/* ═══════════════════════════════════════════
   Game layer — overlays the page
   ═══════════════════════════════════════════ */

.game-layer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: var(--cream);
    padding: 32px 48px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-layer.visible {
    opacity: 1;
}

.game-layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.game-layer-logo {
    cursor: default;
}

.game-close-btn {
    background: none;
    border: 1.5px solid var(--dark);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.game-close-btn:hover {
    background: var(--dark);
    color: var(--white);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.game-card {
    background: var(--white);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
}

.game-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

.game-card-thumb {
    width: 100%;
    height: 160px;
    background: #111;
    overflow: hidden;
}

.game-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-card-info {
    padding: 16px 20px;
}

.game-card-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.game-card-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Game iframe ── */

.game-iframe-wrap {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 210;
    background: #111;
}

/* .visible toggled by JS — display controlled via inline styles */

.game-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-back-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 220;
    background: rgba(0,0,0,0.75);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.game-back-btn:hover {
    opacity: 1;
}

/* ═══════════════════════════════════════════
   Responsive — mobile-first optimizations
   Touch targets, spacing, stacking, safe areas
   ═══════════════════════════════════════════ */

/* ── Tablet (≤900px) ── */

@media (max-width: 900px) {
    .header {
        padding: 16px 20px;
    }

    .logo {
        /* Bigger tap target for secret trigger on touch */
        padding: 8px;
        margin: -8px;
    }

    .hero {
        flex-direction: column;
        min-height: auto;
    }

    .hero-text {
        flex: none;
        padding: 100px 24px 32px;
    }

    .hero-sub br {
        display: none;
    }

    .hero-visual {
        flex: none;
        height: 50vh;
        min-height: 340px;
    }

    .hero-laptop {
        width: 60%;
        margin-top: 30px;
    }

    .hero-hint {
        display: none;
    }

    .features {
        padding: 60px 20px;
    }

    .features-inner {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 24px;
    }

    .stats {
        padding: 48px 20px;
    }

    .stats-inner {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
    }

    .stat-num {
        font-size: 32px;
    }

    .stat-label {
        font-size: 13px;
    }

    .cta-section {
        padding: 60px 20px;
    }

    .cta-section h2 {
        font-size: 28px;
    }

    .cta-section p {
        font-size: 16px;
    }

    .footer {
        padding: 40px 20px 24px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-bottom {
        font-size: 11px;
    }

    /* Game layer — tighter padding on tablet */
    .game-layer {
        padding: 24px 20px;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }
}

/* ── Phone (≤600px) ── */

@media (max-width: 600px) {
    .header {
        padding: 14px 16px;
        /* Safe area for notched phones */
        padding-top: max(14px, env(safe-area-inset-top));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .logo-icon {
        width: 26px;
        height: 26px;
    }

    .logo-text {
        font-size: 18px;
    }

    .login-btn {
        padding: 10px 20px;
        font-size: 12px;
        letter-spacing: 0.04em;
    }

    .hero-text {
        padding: 90px 20px 24px;
    }

    .hero-text h1 {
        font-size: 36px;
        margin-bottom: 4px;
    }

    .hero-squiggle {
        width: 160px;
        margin-bottom: 20px;
    }

    .hero-sub {
        font-size: 17px;
        margin-bottom: 28px;
    }

    .cta-btn {
        padding: 16px 32px;
        font-size: 14px;
        /* Full width on small phones */
        align-self: stretch;
        justify-content: center;
    }

    .hero-visual {
        height: 45vh;
        min-height: 280px;
    }

    .hero-laptop {
        width: 75%;
        margin-top: 20px;
    }

    .screen-content {
        min-height: 140px;
    }

    .screen-formula {
        font-size: 11px;
        padding: 5px 10px;
    }

    .features-inner {
        gap: 12px;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        width: 44px;
        height: 44px;
        font-size: 22px;
        margin-bottom: 14px;
    }

    .feature-card h3 {
        font-size: 16px;
    }

    .feature-card p {
        font-size: 13px;
    }

    .stats-inner {
        flex-direction: column;
        gap: 20px;
    }

    .stat-num {
        font-size: 28px;
    }

    .cta-section {
        padding: 48px 20px;
    }

    .cta-section h2 {
        font-size: 24px;
    }

    .cta-section p {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .cta-section .cta-btn {
        align-self: auto;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-bottom {
        font-size: 10px;
        line-height: 1.8;
        /* Safe area bottom for home indicator */
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    /* Game layer — phone */
    .game-layer {
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
    }

    .game-layer-header {
        margin-bottom: 20px;
    }

    .game-layer-logo .logo-text {
        font-size: 16px;
    }

    .game-close-btn {
        padding: 10px 22px;
        font-size: 15px;
        /* Min tap target 44px */
        min-height: 44px;
    }

    .game-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .game-card-thumb {
        height: 140px;
    }

    .game-card-info {
        padding: 14px 16px;
    }

    /* Game iframe — safe areas, big & visible on mobile */
    .game-back-btn {
        top: max(14px, env(safe-area-inset-top));
        left: max(14px, env(safe-area-inset-left));
        padding: 14px 24px;
        font-size: 16px;
        min-height: 48px;
        opacity: 1;
    }
}

/* ── Very small phones (≤380px) ── */

@media (max-width: 380px) {
    .header {
        padding: 12px 12px;
    }

    .hero-text {
        padding: 84px 16px 20px;
    }

    .hero-text h1 {
        font-size: 30px;
    }

    .hero-sub {
        font-size: 15px;
    }

    .login-btn {
        padding: 8px 16px;
        font-size: 11px;
    }

    .stat-num {
        font-size: 24px;
    }

    .cta-section h2 {
        font-size: 22px;
    }
}

/* ── Landscape phones ── */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        flex-direction: row;
        min-height: 100vh;
    }

    .hero-text {
        padding: 80px 24px 24px 32px;
        flex: 0 0 50%;
    }

    .hero-visual {
        flex: 0 0 50%;
        height: auto;
        min-height: auto;
    }

    .hero-text h1 {
        font-size: 32px;
    }

    .hero-sub {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .cta-btn {
        padding: 12px 28px;
        font-size: 13px;
    }
}

/* ── Touch device hover fix ── */

@media (hover: none) {
    .tile:hover,
    .game-card:hover {
        transform: none;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    }

    .cta-btn:hover {
        transform: none;
    }

    /* Back button fully visible on touch */
    .game-back-btn {
        opacity: 1;
    }

    .game-close-btn:hover {
        background: none;
        color: var(--dark);
    }
}
