/* ===========================================================================
   Harpia Games — base theme
   Dark by default. All colors are CSS vars — change them in one place.
   =========================================================================== */
:root {
    --radius: 0;
    --maxw: 1140px;
    --gap: 1.5rem;
    --header-h: 64px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Dark theme (default) */
:root,
html[data-theme="dark"] {
    --bg: #14131f;
    /* near-black, blue-tinted */
    --bg-soft: #1d1b2d;
    --card: #232140;
    --card-edge: #383558;
    /* dark blue */
    --text: #f4f6ff;
    /* white */
    --muted: #9b9fc4;
    --accent: #f18e34;
    /* orange */
    --accent-press: #d97c1f;
    /* darker orange — hover */
    --accent-2: #caf0ff;
    /* light blue */
    --header-bg: rgba(20, 19, 31, .85);
}

/* Light theme */
html[data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #eef6fd;
    --card: #ffffff;
    --card-edge: #d3e6f3;
    --text: #1c1a2e;
    /* near-black navy */
    --muted: #5c5980;
    --accent: #f18e34;
    /* orange — brand constant */
    --accent-press: #d97c1f;
    --accent-2: #383558;
    /* dark blue — readable secondary on light */
    --header-bg: rgba(255, 255, 255, .85);
}

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

/* No rounded corners anywhere */
*,
*::before,
*::after {
    border-radius: 0 !important;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--accent);
    color: #1b1226;
}

::-moz-selection {
    background: var(--accent);
    color: #1b1226;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-2);
}

.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20 1.25rem;
}

.muted {
    color: var(--muted);
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    margin-bottom: 1rem;
}

.section-head h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
}

main>h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    margin-bottom: 1.5rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Scroll reveal — JS adds .reveal, then .in when the element scrolls into view.
   Wrapped in no-preference so reduced-motion users never get hidden content. */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity .55s ease, transform .55s ease;
    }

    .reveal.in {
        opacity: 1;
        transform: none;
    }
}

main {
    min-height: 60vh;
    padding: 4.5rem 0 4rem;
}

/* --- Header / Nav -------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-edge);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    color: var(--text);
    font-size: 1.15rem;
}

.brand-mark {
    color: var(--accent);
}

.brand-logo {
    height: 30px;
    width: auto;
    display: block;
}

.brand-logo.light {
    display: none;
}

html[data-theme="light"] .brand-logo.dark {
    display: none;
}

html[data-theme="light"] .brand-logo.light {
    display: block;
}

.nav-links {
    display: flex;
    gap: 1.1rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    display: block;
    padding: .5rem .15rem;
    border-radius: 0;
    color: var(--muted);
    font-weight: 500;
    font-size: .95rem;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.nav-links a[aria-current="page"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: .5rem;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: .2s;
}

/* Theme dropdown */
.theme-li {
    display: flex;
    align-items: center;
    margin-left: .35rem;
}

.theme-select {
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--card-edge);
    border-radius: 8px;
    padding: .4rem .6rem;
    font: inherit;
    font-size: .9rem;
    cursor: pointer;
}

.theme-select:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: .7rem 1.3rem;
    border-radius: 0;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: .15s;
}

.btn-primary {
    background: var(--accent);
    color: #1b1226;
}

.btn-primary:hover {
    background: var(--accent-press);
    color: #1b1226;
}

.btn-ghost {
    border-color: var(--card-edge);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
    position: relative;
    text-align: center;
    padding: 5.5rem 1.5rem;
    background:
        linear-gradient(rgba(20, 19, 31, .72), rgba(20, 19, 31, .9)),
        url('../img/hero-harpia.jpg') center / cover no-repeat;
    margin: -4.5rem calc(50% - 50vw) 3rem;
    overflow: hidden;
}

.hero-logo {
    display: block;
    width: min(440px, 80%);
    height: auto;
    margin: 0 auto 1.5rem;
}

.hero p.lead {
    color: rgba(244, 246, 255, .88);
    font-size: 1.2rem;
    max-width: 620px;
    margin: 1rem auto 2rem;
}

.hero .btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
}

.hero .btn-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.hero .actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Section header ------------------------------------------------------ */
.section {
    margin-bottom: 3.5rem;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-head p {
    color: var(--muted);
}

/* --- Card grid ----------------------------------------------------------- */
.grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: .18s;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.card .icon {
    font-size: 2rem;
}

.card h3 {
    font-size: 1.25rem;
}

.card .tagline {
    color: var(--accent);
    font-size: .9rem;
    font-weight: 600;
}

.card p {
    color: var(--muted);
    font-size: .95rem;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.tag {
    font-size: .72rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--muted);
    border: 1px solid var(--card-edge);
}

.card-actions {
    display: flex;
    gap: 1rem;
    margin-top: .5rem;
    font-size: .9rem;
    font-weight: 600;
}

/* --- Cards with media (games + tools) ----------------------------------- */
.game-card .thumb,
.tool-card .thumb {
    display: block;
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
}

.game-card .thumb img,
.tool-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s;
}

.tool-card:hover .thumb img {
    transform: scale(1.04);
}

.tool-card .thumb {
    position: relative;
}

.free-badge {
    background: var(--accent);
    color: #1b1226;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .2rem .55rem;
}

.tool-card .free-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 2;
}

.free-badge-inline {
    display: inline-block;
    margin-bottom: .75rem;
}

.tool-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* clamp long descriptions on cards */
}

/* Whole-card click: stretched link covers the card; Docs link sits above it */
.tool-card {
    position: relative;
    cursor: pointer;
}

.tool-card h3 a.stretched-link {
    color: inherit;
    text-decoration: none;
}

.tool-card .stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tool-card .card-actions {
    position: relative;
    z-index: 2;
}

/* --- Tool detail page ---------------------------------------------------- */
.tool-hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 3rem;
}

.tool-hero-media {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--card-edge);
    aspect-ratio: 16/9;
    background: var(--bg-soft);
}

.tool-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-hero-media iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.tool-hero-body h1 {
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    margin-bottom: .5rem;
}

.store-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}

.store-buttons .btn-store {
    flex: 1 1 0;
    min-width: 160px;
    max-width: 240px;
    text-align: center;
}

.btn-store {
    background: var(--accent);
    color: #1b1226;
}

.btn-store:hover {
    background: var(--accent-press);
    color: #1b1226;
}

.tool-about {
    max-width: 80ch;
}

.tool-about p {
    color: var(--muted);
    max-width: 70ch;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: grid;
    gap: .65rem;
}

.feature-list li {
    position: relative;
    padding-left: 1.7rem;
    color: var(--muted);
}

.feature-list li::before {
    content: "🖌️";
    position: absolute;
    left: 0;
    top: 0;
    font-size: .9rem;
}

.feature-list li strong {
    color: var(--text);
    font-weight: 700;
}

.desc-note {
    border-left: 3px solid var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    padding: .8rem 1rem;
    margin: 1rem 0;
    color: var(--text);
}

.gallery {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.shot {
    display: block;
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--card-edge);
    background: var(--bg-soft);
}

.shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s;
}

.shot:hover img {
    transform: scale(1.05);
}

@media (max-width: 760px) {
    .tool-hero {
        grid-template-columns: 1fr;
    }
}

/* --- Doc index cards (3-col thumbnail grid) ------------------------------ */
.doc-grid {
    grid-template-columns: repeat(3, 1fr);
}

.doc-card {
    color: var(--text);
    text-align: center;
    align-items: center;
    gap: 1rem;
}

.doc-card:hover {
    color: var(--text);
    text-decoration: none;
}

.doc-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
    display: grid;
    place-items: center;
}

.doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s;
}

.doc-card:hover .doc-thumb img {
    transform: scale(1.04);
}

.doc-emoji {
    font-size: 3rem;
}

.doc-card h3 {
    font-size: 1.15rem;
    margin: 0;
}

@media (max-width: 880px) {
    .doc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .doc-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Docs list ----------------------------------------------------------- */
.doc-list {
    list-style: none;
    display: grid;
    gap: .75rem;
}

.doc-list li {
    background: var(--card);
    border: 1px solid var(--card-edge);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.doc-list .doc-name {
    font-weight: 600;
}

/* --- Tutorials ----------------------------------------------------------- */
.video-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.video-embed {
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--card-edge);
}

.trailer-embed {
    max-width: 760px;
}

.video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Forms --------------------------------------------------------------- */
.form {
    max-width: 560px;
    display: grid;
    gap: 1.1rem;
}

.hp-field {
    display: none;
}

.form-hint {
    font-size: .9rem;
    color: var(--text);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border-left: 3px solid var(--accent);
    padding: .65rem .85rem;
    margin: 0 0 .25rem;
}

.form-hint[hidden] {
    display: none;
}

.form-note {
    font-size: .8rem;
    color: var(--muted);
    margin: .25rem 0 0;
}

.field {
    display: grid;
    gap: .4rem;
}

.field label {
    font-weight: 600;
    font-size: .95rem;
}

.field input,
.field textarea,
.field select {
    background: var(--bg-soft);
    border: 1px solid var(--card-edge);
    border-radius: 10px;
    color: var(--text);
    padding: .75rem .9rem;
    font: inherit;
    width: 100%;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}

.field textarea {
    min-height: 140px;
    resize: vertical;
}

.alert {
    padding: .9rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.alert-ok {
    background: color-mix(in srgb, var(--accent-2) 12%, transparent);
    border-color: var(--accent-2);
    color: var(--text);
}

.alert-err {
    background: rgba(239, 68, 68, .1);
    border-color: #ef4444;
    color: var(--text);
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--card-edge);
    background: var(--bg-soft);
    padding: 3rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 2fr 1fr 1fr;
}

.footer-grid h4 {
    margin-bottom: .75rem;
    font-size: .95rem;
}

.footer-grid ul {
    list-style: none;
    display: grid;
    gap: .4rem;
}

.footer-grid a {
    color: var(--muted);
}

.footer-grid a:hover {
    color: var(--accent);
}

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-edge);
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 760px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg-soft);
        border-bottom: 1px solid var(--card-edge);
        padding: .5rem 1rem 1rem;
        display: none;
    }

    .nav-links.open {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}