/*
 * crackanoid.com, in ivystudio's design system (ivystudio.eu): ink and ivy,
 * Inter, light and dark ([data-theme], set by /main.js).
 */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url(/fonts/inter-latin.woff2) format('woff2');
}

:root, [data-theme="light"] {
    --ink-900: #0B0C10;
    --ink-800: #141619;
    --ink-700: #2D3037;
    --ink-600: #4A4E59;
    --ink-500: #6B7080;
    --ink-400: #8A8F9E;
    --ink-300: #B0B5C1;
    --ink-200: #D1D5DF;
    --ink-100: #EAECEF;
    --ink-50:  #F4F5F7;

    --ivy-900: #0D2118;
    --ivy-800: #123024;
    --ivy-700: #17402F;
    --ivy-600: #1E5540;
    --ivy-500: #276B50;
    --ivy-400: #35895F;
    --ivy-300: #58A87D;
    --ivy-200: #8DC8A6;

    --primary: var(--ivy-700);
    --primary-dark: var(--ivy-800);
    --primary-light: var(--ivy-400);
    --primary-glow: rgba(23, 64, 47, 0.10);
    --primary-glow-strong: rgba(23, 64, 47, 0.18);

    --logo-ivy: var(--ivy-700);
    --logo-studio: var(--ink-600);
    --logo-leaf: var(--ivy-400);

    --text: var(--ink-900);
    --text-secondary: var(--ink-700);
    --text-muted: var(--ink-500);

    --surface: #FFFFFF;
    --surface-2: var(--ink-50);
    --surface-3: var(--ink-100);
    --border: var(--ink-200);
    --border-strong: var(--ink-300);

    --glass-bg: rgba(255, 255, 255, 0.88);
    --glass-border: rgba(0, 0, 0, 0.06);

    --shadow-sm: 0 1px 2px rgba(11, 12, 16, 0.04);
    --shadow: 0 2px 8px rgba(11, 12, 16, 0.06);
    --shadow-md: 0 4px 16px rgba(11, 12, 16, 0.08);
    --shadow-lg: 0 8px 32px rgba(11, 12, 16, 0.10);

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    --font: 'Inter', 'Helvetica Neue', system-ui, sans-serif;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;

    /* the game's own night sky, behind the screenshots in both themes */
    --game-bg: #0b0816;
    color-scheme: light;
}

[data-theme="dark"] {
    --primary: var(--ivy-400);
    --primary-dark: var(--ivy-500);
    --primary-light: var(--ivy-300);
    --primary-glow: rgba(53, 137, 95, 0.12);
    --primary-glow-strong: rgba(53, 137, 95, 0.20);

    --logo-ivy: var(--ivy-300);
    --logo-studio: var(--ink-300);

    --text: #E8EAF0;
    --text-secondary: #B0B5C1;
    --text-muted: #6B7080;

    --surface: #0B0C10;
    --surface-2: #141619;
    --surface-3: #1E2028;
    --border: #2D3037;
    --border-strong: #4A4E59;

    --glass-bg: rgba(11, 12, 16, 0.90);
    --glass-border: rgba(255, 255, 255, 0.04);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-dark); }
[data-theme="dark"] a:hover { color: var(--primary-light); }
p { color: var(--text-secondary); line-height: 1.7; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.035em; color: var(--text); font-weight: 700; }
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: 1.0625rem; letter-spacing: -0.02em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 780px; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.8125rem 1.625rem; border-radius: var(--radius);
    font: 600 0.9375rem var(--font); border: none; cursor: pointer;
    transition: all var(--transition-base); white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--ivy-700); color: #fff; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .btn--primary { background: var(--primary); }
.btn--primary:hover { background: var(--ivy-800); color: #fff; box-shadow: var(--shadow-md); }
[data-theme="dark"] .btn--primary:hover { background: var(--primary-dark); color: #fff; }
.btn--outline { background: transparent; color: var(--text); border: 1.5px solid var(--border-strong); }
.btn--disabled { pointer-events: none; opacity: 0.55; }
.btn--lg { padding: 1rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn .arrow { width: 16px; height: 16px; transition: transform var(--transition-fast); }
.btn:hover .arrow { transform: translateX(2px); }

/* ── Navigation ── */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}
.nav__inner {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    height: 68px; max-width: 1120px; margin: 0 auto; padding: 0 1.5rem;
}
.nav__brand {
    display: flex; align-items: center; gap: 0.625rem;
    font-weight: 800; font-size: 1.0625rem; letter-spacing: -0.03em; color: var(--text);
}
.nav__brand:hover { color: var(--text); }
.nav__brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav__links { display: flex; align-items: center; gap: 0.125rem; margin-left: auto; }
.nav__links a {
    color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
    padding: 0.5rem 0.875rem; border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.nav__links a:hover, .nav__links a[aria-current] { color: var(--text); background: var(--surface-3); }
.theme-toggle {
    background: var(--surface-2); color: var(--text-muted);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    width: 36px; height: 36px; flex-shrink: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.theme-toggle svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
    .nav__brand span { display: none; }
    .nav__links .wide-only { display: none; }
    .nav__links a { padding: 0.5rem 0.625rem; }
}

/* ── ivystudio's wordmark: "ivy" green + "studio" gray, the first i dotted with a leaf ── */
.logo { display: inline-flex; align-items: baseline; line-height: 1; letter-spacing: -0.045em; }
.logo__ivy { font-weight: 800; color: var(--logo-ivy); }
.logo__studio { font-weight: 400; color: var(--logo-studio); }
.logo__i { position: relative; display: inline-block; }
.logo__leaf {
    position: absolute; left: 50%; bottom: 0.66em;
    width: 0.27em; height: 0.27em; max-width: none;
    transform: translateX(-50%) rotate(14deg); transform-origin: 50% 100%;
    fill: var(--logo-leaf); transition: transform var(--transition-base);
}
.logo__vein { fill: none; stroke: var(--surface-2); stroke-width: 0.8; stroke-linecap: round; }
.logo:hover .logo__leaf { transform: translateX(-50%) rotate(-8deg); }

/* ── Hero ── */
.hero { position: relative; padding: 5rem 0 3rem; overflow: hidden; text-align: center; }
.hero::before {
    content: ''; position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
    width: 1000px; height: 600px; pointer-events: none;
    background: radial-gradient(ellipse at center, var(--primary-glow-strong) 0%, transparent 70%);
}
.hero > * { position: relative; }
.hero__icon {
    width: 112px; height: 112px; border-radius: 26px; margin: 0 auto 1.75rem;
    box-shadow: var(--shadow-lg);
}
.badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.3125rem 0.875rem; margin-bottom: 1.5rem;
    background: var(--primary-glow); color: var(--primary);
    border: 1px solid var(--primary-glow-strong); border-radius: var(--radius-full);
    font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em;
}
.badge__dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }
.hero h1 { margin-bottom: 1.25rem; }
.hero h1 .accent {
    background: linear-gradient(135deg, var(--ink-900) 0%, var(--primary) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .hero h1 .accent { background-image: linear-gradient(135deg, var(--ivy-200) 0%, var(--primary) 100%); }
.lead { font-size: 1.125rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 2rem; }
.actions { display: flex; align-items: center; justify-content: center; gap: 0.875rem; flex-wrap: wrap; }
.note { color: var(--text-muted); font-size: 0.875rem; margin-top: 1.25rem; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.375rem; margin-top: 2rem; }
.chip {
    padding: 0.1875rem 0.625rem; border: 1px solid var(--border); border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); background: var(--surface);
}

/* ── Sections ── */
.section { padding: 4.5rem 0; }
.section--alt { background: var(--surface-2); }
.section__head { text-align: center; margin-bottom: 3rem; }
.section__head h2 { margin-bottom: 0.875rem; }
.section__head p { font-size: 1.0625rem; color: var(--text-muted); max-width: 560px; margin: 0 auto; }
.label {
    display: inline-block; margin-bottom: 0.75rem;
    font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--primary);
}

/* ── Gallery: rows of screenshots from every device, each as wide as its
   aspect (flex-grow), so a row's pictures stand equally high ── */
.gallery .row { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: flex-start; }
.gallery figure { flex-basis: 0; min-width: 0; }
.gallery img {
    width: 100%; border-radius: var(--radius-lg); background: var(--game-bg);
    box-shadow: var(--shadow-md); border: 1px solid var(--glass-border);
}
.gallery figcaption {
    margin-top: 0.5rem; text-align: center;
    font-size: 0.75rem; font-weight: 500; color: var(--text-muted);
}
@media (max-width: 640px) {
    .gallery .row { flex-wrap: wrap; gap: 0.75rem; }
    .gallery figure.wide { flex-basis: 100%; order: 1; }
}

/* ── Features ── */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.feature {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl); padding: 1.5rem; box-shadow: var(--shadow);
    transition: all var(--transition-base);
}
.feature:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.feature__icon {
    width: 44px; height: 44px; border-radius: var(--radius); margin-bottom: 1rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-glow); color: var(--primary);
}
.feature__icon svg {
    width: 22px; height: 22px; fill: none; stroke: currentColor;
    stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.feature h3 { margin-bottom: 0.375rem; }
.feature p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ── Platforms ── */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 3rem; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 2rem; } }
.split img {
    width: 100%; border-radius: var(--radius-xl); background: var(--game-bg);
    box-shadow: var(--shadow-lg); border: 1px solid var(--glass-border);
}
.specs {
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    overflow: hidden; background: var(--surface);
}
.specs div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0.875rem 1.25rem; font-size: 0.875rem; }
.specs div + div { border-top: 1px solid var(--border); }
.specs dt { font-weight: 600; color: var(--text); }
.specs dd { color: var(--text-secondary); }
@media (max-width: 480px) { .specs div { grid-template-columns: 1fr; gap: 0.125rem; } }

/* ── Story band ── */
.band {
    background: var(--ink-900); border-radius: var(--radius-2xl);
    padding: 3.5rem 3rem; text-align: center; position: relative; overflow: hidden;
}
[data-theme="dark"] .band { background: linear-gradient(135deg, var(--ivy-800), var(--ivy-600)); }
.band h2 { color: #fff; margin-bottom: 0.75rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.band p { color: rgba(255, 255, 255, 0.72); max-width: 560px; margin: 0 auto 1.75rem; }
.band .btn--primary { background: #fff; color: var(--ink-900); }
.band .btn--primary:hover { background: var(--ink-100); color: var(--ink-900); }
@media (max-width: 600px) { .band { padding: 2.5rem 1.5rem; } }

/* ── Text pages (support, privacy) ── */
.page { padding: 4rem 0 2rem; }
.page h1 { font-size: clamp(2.25rem, 5vw, 3.25rem); margin-bottom: 1rem; }
.page .lead { margin: 0 0 2.5rem; }
.qa {
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 0.5rem 1.75rem;
}
.qa section { padding: 1.25rem 0; }
.qa section + section { border-top: 1px solid var(--border); }
.qa h3 { margin-bottom: 0.375rem; }
.qa p { font-size: 0.9375rem; }
.qa p + p { margin-top: 0.75rem; }

/* ── Footer ── */
.footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 3.5rem 0 2rem; margin-top: 4.5rem; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
.footer__brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); margin-bottom: 0.75rem; }
.footer__brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer__desc { color: var(--text-muted); font-size: 0.875rem; max-width: 300px; }
.footer h4 {
    font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-muted); font-weight: 700; margin-bottom: 0.875rem;
}
.footer__grid a { display: block; color: var(--text-secondary); font-size: 0.875rem; padding: 0.25rem 0; }
.footer__grid a:hover { color: var(--primary); }
.footer__bottom {
    border-top: 1px solid var(--border); padding-top: 1.5rem;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
    color: var(--text-muted); font-size: 0.8125rem;
}
.footer__bottom .logo { font-size: 1.0625rem; vertical-align: -0.05em; }
.footer__bottom a.mail { color: var(--text-muted); }
.footer__bottom a.mail:hover { color: var(--primary); }
@media (max-width: 768px) {
    .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .footer__grid > :first-child { grid-column: 1 / -1; }
    .footer__bottom { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, .logo__leaf { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}
