/* ===================================================================
   KaoTech — standalone site styles
   Brand: black base, blue #3a50c0, orange #e8891d (from the logo).
   Dark by default, light theme via toggle.
   =================================================================== */

:root {
    --kao-blue: #3a50c0;
    --kao-blue-bright: #8fa1f5;
    --kao-orange: #e8891d;

    --bg: #0a0a0d;
    --bg-elevated: #101017;
    --bg-card: #14141d;
    --text: #f2f2f6;
    --text-muted: #a2a7bd;
    --border: #262633;
    --accent: var(--kao-orange);
    --heading-accent: var(--kao-blue-bright);
    --nav-bg: rgba(10, 10, 13, 0.88);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

body.light-mode {
    --bg: #f4f4f6;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --text: #17181f;
    --text-muted: #575d75;
    --border: #dcdde6;
    --accent: #c86e0a;
    --heading-accent: var(--kao-blue);
    --nav-bg: rgba(255, 255, 255, 0.88);
    --shadow: 0 8px 24px rgba(23, 24, 31, 0.12);
}

* { box-sizing: border-box; }

/* The hidden attribute must win over component display rules like
   .btn { display: inline-block } (author CSS otherwise beats the UA
   [hidden] rule, leaving "hidden" buttons visible). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

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

body {
    margin: 0;
    font-family: "Fredoka", "Segoe UI", system-ui, sans-serif;
    background-color: var(--bg);
    /* Honeycomb tile across the whole page — a nod to the logo's infill */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z' fill='%23e8891d' fill-opacity='0.045'/%3E%3C/svg%3E");
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.light-mode {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z' fill='%23c86e0a' fill-opacity='0.10'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 1.2rem;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.brand-kao { color: var(--heading-accent); }
.brand-tech { color: var(--kao-orange); }

.site-nav nav {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.site-nav nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-weight: 500;
    transition: color 0.2s, background 0.2s;
}

.site-nav nav a:hover {
    color: var(--text);
    background: var(--bg-card);
}

#theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 1.05rem;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

#theme-toggle:hover { transform: scale(1.12); }

/* ------------------------------------------------------------------
   Hero — honeycomb over black, blue + orange glows
   ------------------------------------------------------------------ */
.hero {
    text-align: center;
    padding: 4.5rem 1.5rem;
    background-image:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(58, 80, 192, 0.30), transparent),
        radial-gradient(ellipse 50% 45% at 85% 35%, rgba(232, 137, 29, 0.14), transparent);
}

body.light-mode .hero {
    background-image:
        radial-gradient(ellipse 70% 60% at 50% 0%, rgba(58, 80, 192, 0.12), transparent),
        radial-gradient(ellipse 50% 45% at 85% 35%, rgba(232, 137, 29, 0.08), transparent);
}

.hero-banner {
    width: min(620px, 90vw);
    height: auto;
    background: #0d0d0d;
    border: 1px solid rgba(232, 137, 29, 0.35);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: 0 0 35px rgba(232, 137, 29, 0.25);
    margin-bottom: 1.5rem;
}

.tagline {
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    color: var(--text-muted);
    max-width: 36em;
    margin: 0 auto 2rem;
}

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

/* ------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--kao-orange);
    color: #2b1600;
    box-shadow: 0 4px 16px rgba(232, 137, 29, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 137, 29, 0.55);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--kao-blue);
}

.btn-ghost:hover {
    border-color: var(--kao-orange);
    transform: translateY(-2px);
}

/* ------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------ */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 600;
    margin: 0 0 0.5rem;
}

/* Hexagon section markers — a nod to the logo's infill */
.hex {
    display: inline-block;
    width: 16px;
    height: 14px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    flex-shrink: 0;
}

.hex-orange { background: var(--kao-orange); filter: drop-shadow(0 0 6px var(--kao-orange)); }
.hex-blue   { background: var(--kao-blue-bright); filter: drop-shadow(0 0 6px var(--kao-blue)); }

/* ------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--kao-orange);
}

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

.card h3 {
    margin: 0 0 0.4rem;
    font-weight: 600;
    color: var(--heading-accent);
}

.card p { margin: 0; color: var(--text-muted); }

/* ------------------------------------------------------------------
   Steps
   ------------------------------------------------------------------ */
.steps {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
}

.steps li {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
}

.steps li:hover {
    transform: translateY(-4px);
    border-color: var(--kao-blue);
}

.steps h3 {
    margin: 0 0 0.4rem;
    font-weight: 600;
    color: var(--heading-accent);
}

.steps p { margin: 0; color: var(--text-muted); }

/* ------------------------------------------------------------------
   Shop — product cards
   ------------------------------------------------------------------ */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-card p {
    /* Teaser only — clamp to 4 lines on the card; full text shows in the modal. */
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 0.6rem;
    background: #0d0d0d;
}

/* Clickable thumbnail strip under the primary photo — signals "more angles". */
.card-thumbs {
    display: flex;
    gap: 0.4rem;
    margin: 0 0 0.7rem;
    flex-wrap: wrap;
}

.card-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background-size: cover;
    background-position: center;
    background-color: #0d0d0d;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
    transition: border-color 0.15s, transform 0.1s;
}

.card-thumb:hover { border-color: var(--kao-orange); transform: translateY(-1px); }

.card-thumb-more {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--kao-orange);
    background: var(--bg-elevated);
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: auto;   /* pin to the bottom so footers align even with a clamped description */
}

.price {
    font-weight: 600;
    color: var(--kao-orange);
    border: 1.5px solid var(--kao-orange);
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

/* ------------------------------------------------------------------
   Order form
   ------------------------------------------------------------------ */
.order-form {
    max-width: 720px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.8rem;
    box-shadow: var(--shadow);
}

.order-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr; }
}

.order-form input,
.order-form textarea,
.order-form select {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.8rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.2s;
}

.order-form input:focus,
.order-form textarea:focus,
.order-form select:focus {
    outline: none;
    border-color: var(--kao-orange);
}

.order-form textarea { resize: vertical; }

/* Short "why choose this" blurb under the Material dropdown. */
.material-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-muted);
}
.material-hint:empty { display: none; }

/* Cloudflare Turnstile bot-check widget (renders into the order form when configured) */
.cf-turnstile-mount { margin: 0.75rem 0 0.25rem; }
.cf-turnstile-mount:empty { margin: 0; }

.req { color: var(--kao-orange); }

.opt {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85em;
}

/* fulfillment + address */
.fulfillment {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem 0.9rem;
    margin: 0 0 1.1rem;
}

.fulfillment legend {
    font-weight: 500;
    padding: 0 0.4rem;
}

.fulfillment .radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    margin: 0.35rem 0 0;
    cursor: pointer;
}

.fulfillment .radio input {
    width: auto;
    margin: 0;
    accent-color: var(--kao-orange);
}

.ship-note {
    margin: 0.6rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-row-3 { grid-template-columns: 2fr 1fr 1fr; }

@media (max-width: 560px) {
    .form-row-3 { grid-template-columns: 1fr; }
}

.order-form input[type="file"] {
    padding: 0.45rem 0.6rem;
    cursor: pointer;
}

.order-form input[type="file"]::file-selector-button {
    font: inherit;
    background: var(--kao-blue);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.35rem 1rem;
    margin-right: 0.8rem;
    cursor: pointer;
}

.shop-empty { color: var(--text-muted); }

.shop-divider {
    grid-column: 1 / -1;
    margin: 1.2rem 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    border-top: 1px solid var(--border);
    padding-top: 1.4rem;
}

.shop-divider span {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
}

.dig-badge {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: #1c3a52;
    color: #8fc6f5;
    padding: 0.14rem 0.55rem;
    border-radius: 999px;
    vertical-align: middle;
}

.closed-note {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1.5px dashed var(--kao-orange);
    border-radius: 16px;
    padding: 1.4rem 1.6rem;
    grid-column: 1 / -1;
}

.closed-note span { font-size: 2rem; line-height: 1; }

.closed-note strong { color: var(--heading-accent); }

.closed-note p { margin: 0.2rem 0 0; color: var(--text-muted); }

/* ------------------------------------------------------------------
   Product modal
   ------------------------------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 200; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
}

.modal-card {
    position: relative;
    max-width: 460px;
    margin: 8vh auto 0;
    max-height: 84vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.6rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.modal-close {
    position: absolute;
    top: 0.7rem;
    right: 0.9rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover { color: var(--kao-orange); }

.modal-media { text-align: center; }

.modal-icon { font-size: 4.5rem; }

.modal-img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    background: #0d0d0d;
}

.modal-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    background: #0d0d0d;
    transition: border-color 0.15s;
}

.modal-thumb:hover { border-color: var(--kao-blue-bright); }
.modal-thumb.active { border-color: var(--kao-orange); }

.modal-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0 0 1rem;
}

.modal-opt {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: left;
}

.modal-opt select {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
}

.modal-opt select:focus { outline: none; border-color: var(--kao-orange); }

.modal-card h3 {
    margin: 0.8rem 0 0.4rem;
    color: var(--heading-accent);
    font-size: 1.3rem;
}

.modal-card p {
    color: var(--text-muted);
    margin: 0 0 1rem;
    /* Full description — keep the author's line breaks, scroll if it's very long. */
    white-space: pre-wrap;
    overflow-wrap: break-word;
    max-height: 45vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* honeypot — hidden from humans, visible to naive bots */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

#form-status { margin: 0; font-weight: 500; }

.status-ok { color: #4caf70; }

.status-err { color: #e05a4e; }

/* ------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------ */
footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    margin-top: 2rem;
}

footer p { margin: 0.3rem 0; }

.footer-note { color: var(--text-muted); font-size: 0.92rem; }

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

.footer-note a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------ */
@media (max-width: 640px) {
    .site-nav nav a { padding: 0.35rem 0.55rem; font-size: 0.92rem; }
    .hero { padding: 3rem 1rem; }
}

/* ------------------------------------------------------------------
   Section sub-heading
   ------------------------------------------------------------------ */
.section-sub { color: var(--text-muted); max-width: 46em; margin: 0.2rem 0 0; }

/* ------------------------------------------------------------------
   Gallery + lightbox
   ------------------------------------------------------------------ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.gallery-item {
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
}

.gallery-item:hover,
.gallery-item:focus-visible {
    transform: translateY(-4px);
    border-color: var(--kao-orange);
    outline: none;
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #0d0d0d;
}

.gallery-item figcaption {
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(3px);
}

.lightbox-figure {
    position: relative;
    margin: 0;
    max-width: 900px;
    text-align: center;
}

.lightbox-figure img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.lightbox-figure figcaption { margin-top: 0.8rem; color: #f2f2f6; }

/* ------------------------------------------------------------------
   FAQ accordion
   ------------------------------------------------------------------ */
.faq-list { margin-top: 1.5rem; max-width: 780px; }

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.7rem;
    overflow: hidden;
}

.faq-item summary {
    cursor: pointer;
    padding: 1rem 1.2rem;
    font-weight: 600;
    color: var(--heading-accent);
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    color: var(--kao-orange);
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
}

.faq-item[open] summary::after { content: '\2013'; }

.faq-item p {
    margin: 0;
    padding: 0 1.2rem 1.1rem;
    color: var(--text-muted);
    white-space: pre-wrap;
}

/* ------------------------------------------------------------------
   Footer socials
   ------------------------------------------------------------------ */
.footer-social {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.footer-social a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: color 0.2s;
}

.footer-social a:hover { color: var(--kao-orange); }

/* ------------------------------------------------------------------
   Back-to-top button — appears after scrolling past the hero
   ------------------------------------------------------------------ */
.back-to-top {
    position: fixed;
    left: 1.2rem;
    bottom: 1.2rem;
    z-index: 150;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--kao-orange);
    color: #2b1600;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(232, 137, 29, 0.45);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, filter 0.2s, box-shadow 0.2s;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(232, 137, 29, 0.6);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--kao-orange);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transform: none;
        transition: opacity 0.25s, visibility 0.25s, background 0.2s, color 0.2s;
    }
}
