/* Wolfe's 3D Prints - design system.
   One token set drives every component so pages stay consistent:
   surfaces, radii, shadows, controls and buttons all share values.
   Brand palette (from the logo): red #ee3a3b, deep teal #144c67,
   bright cyan #5db4d9, warm amber #ffb020. The logo itself stays B/W. */
:root {
    color-scheme: dark;
    --bg: #0a0f16;
    --surface-1: #121a26;
    --surface-2: #182233;
    --surface-inset: #0b1017;
    --img-bg: #16303e;
    --text: #f4f6f9;
    --muted: #a5b4c6;
    --accent: #ee3a3b;
    --accent-dark: #c92a2b;
    --amber: #ffb020;
    --teal: #144c67;
    --teal-mid: #2a7ea6;
    --teal-bright: #5db4d9;
    --danger: #e5484d;
    --ok: #2fbb6b;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --radius: 18px;
    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.30);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
    --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--teal-bright);
    --control-h: 48px;
    --ease: 0.16s ease;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background:
        radial-gradient(1100px 520px at 88% -100px, rgba(20, 76, 103, 0.75), transparent 62%),
        radial-gradient(820px 480px at -12% 240px, rgba(238, 58, 59, 0.20), transparent 58%),
        radial-gradient(900px 500px at 50% 115%, rgba(255, 176, 32, 0.10), transparent 60%),
        linear-gradient(180deg, #0d1622, var(--bg) 380px);
    background-attachment: fixed;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    font-size: 16.5px;
    -webkit-tap-highlight-color: transparent;
}
::selection { background: rgba(238, 58, 59, 0.5); }
a { color: var(--teal-bright); text-underline-offset: 2px; }
a:hover { color: #93d2ee; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 18px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; text-wrap: balance; }
h1 { font-size: 1.9em; font-weight: 850; }
h2 { font-size: 1.45em; font-weight: 800; }
h3 { font-size: 1.12em; font-weight: 750; }
.grad {
    background: linear-gradient(92deg, #ff7a5c, var(--accent) 45%, var(--amber));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.small { color: var(--muted); font-size: 0.9em; }
code { background: var(--surface-inset); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border); font-size: 0.92em; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10, 15, 22, 0.85);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.site-header::after {
    content: ''; display: block; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--amber), var(--teal-bright), var(--teal));
    opacity: 0.9;
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); min-height: 44px; border-radius: var(--r-sm); }
.brand img { height: 40px; width: auto; display: block; }
.brand-name { font-weight: 800; font-size: 1.06em; letter-spacing: -0.01em; white-space: nowrap; }
nav { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-width: 100%; }
nav::-webkit-scrollbar { display: none; }
nav a {
    color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.94em;
    padding: 10px 13px; border-radius: 999px; white-space: nowrap;
    display: inline-flex; align-items: center; min-height: 44px;
    transition: background var(--ease), color var(--ease);
}
nav a:hover, nav a:active { background: rgba(93, 180, 217, 0.16); color: #fff; }
.nav-user { color: var(--amber); font-size: 0.88em; font-weight: 600; padding: 0 6px; white-space: nowrap; }

main.wrap { padding-top: 28px; padding-bottom: 52px; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); padding: 24px 0 calc(30px + env(safe-area-inset-bottom)); font-size: 0.92em; text-align: center; }
.site-footer p { margin: 4px 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* Hero */
.hero { text-align: center; padding: 34px 0 12px; }
.hero-logo {
    width: 148px; max-width: 52vw; height: auto;
    display: inline-block;
    filter: drop-shadow(0 0 26px rgba(93, 180, 217, 0.35)) drop-shadow(0 14px 28px rgba(0, 0, 0, 0.5));
}
.hero h1 { margin: 20px 0 8px; font-size: clamp(1.9em, 6.2vw, 2.9em); }
.lede { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 1.05em; }

/* How-it-works steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 4px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } }
.step {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; display: grid; gap: 6px; align-content: start;
}
.step h3 { margin: 4px 0 0; }
.step p { margin: 0; color: var(--muted); font-size: 0.95em; }
.step-num {
    width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 850; font-size: 1.15em; color: #fff;
    box-shadow: var(--shadow-sm);
}
.step-num.n1 { background: linear-gradient(145deg, #f04445, var(--accent-dark)); }
.step-num.n2 { background: linear-gradient(145deg, var(--teal-mid), var(--teal)); }
.step-num.n3 { background: linear-gradient(145deg, #ffc44d, #f59e0b); color: #2a1a00; }

/* Cards - the one surface style used across the whole site */
.card {
    position: relative;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 22px 0;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--amber), var(--teal-bright));
    opacity: 0.9;
}
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.muted-card { background: linear-gradient(180deg, #14202f, #101825); }

/* Forms - every text control on the site shares this style */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 7px; font-weight: 600; font-size: 0.95em; }
.form input, .form select, .form textarea, .idea-search input, .captcha-row input {
    background: var(--surface-inset); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 13px 14px; font: inherit; font-size: 16px; font-weight: 400;
    width: 100%; appearance: none; min-height: var(--control-h);
    transition: border-color var(--ease), box-shadow var(--ease);
}
.form textarea { min-height: 0; }
.form input:hover, .form select:hover, .form textarea:hover, .idea-search input:hover, .captcha-row input:hover { border-color: var(--border-strong); }
.form input:focus, .form select:focus, .form textarea:focus, .idea-search input:focus, .captcha-row input:focus {
    outline: none; border-color: var(--teal-bright);
    box-shadow: 0 0 0 3px rgba(93, 180, 217, 0.25);
}
.form input[type="file"] { padding: 11px 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 130px; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Buttons - one system: primary (red), alt (teal), danger, small */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, #f04445, var(--accent-dark));
    color: #fff; border: 0; min-height: var(--control-h);
    padding: 12px 22px; border-radius: var(--r-md); font: inherit; font-weight: 700;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 8px 22px rgba(238, 58, 59, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.08s ease, box-shadow var(--ease), filter var(--ease);
}
.btn:hover { filter: brightness(1.08); color: #fff; }
.btn:active { transform: scale(0.98); }
.btn-alt {
    background: linear-gradient(180deg, var(--teal-mid), var(--teal));
    box-shadow: 0 8px 22px rgba(20, 76, 103, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-small { padding: 8px 14px; min-height: 40px; font-size: 0.9em; border-radius: var(--r-sm); }
.btn-danger { background: linear-gradient(180deg, #e5484d, #b92f34); box-shadow: 0 8px 20px rgba(229, 72, 77, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
@media (max-width: 640px) { .form .btn { width: 100%; } }
.inline-form { display: inline-block; margin-right: 8px; }

/* Feedback banners */
.flash { background: rgba(47, 187, 107, 0.15); border: 1px solid rgba(47, 187, 107, 0.55); color: #c9f5da; padding: 13px 16px; border-radius: var(--r-md); margin-bottom: 18px; font-weight: 600; }
.errors { background: rgba(229, 72, 77, 0.13); border: 1px solid rgba(229, 72, 77, 0.55); color: #ffd7d8; padding: 10px 16px; border-radius: var(--r-md); margin: 14px 0; }
.errors p { margin: 4px 0; }
.flash-field { outline: 3px solid var(--amber) !important; outline-offset: 1px; }

/* Library grid */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 16px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; } }
.tile {
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    text-decoration: none; color: var(--text); display: block;
    transition: transform 0.12s ease, border-color var(--ease), box-shadow var(--ease);
}
.tile:hover, .tile:active { border-color: rgba(93, 180, 217, 0.65); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); }
.tile img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--img-bg); }
@media (min-width: 700px) { .tile img { height: 170px; } }
.tile-noimg { height: 150px; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.85); font-weight: 800; font-size: 1.6em; letter-spacing: 0.04em; background: linear-gradient(150deg, var(--teal-mid), var(--teal)); }
@media (min-width: 700px) { .tile-noimg { height: 170px; } }
.tile-noimg.ext-3mf { background: linear-gradient(150deg, #f04445, #8f1d1e); }
.tile-noimg.ext-zip { background: linear-gradient(150deg, #ffc44d, #b97a0c); color: #2a1a00; }
.tile-body { padding: 13px 15px; display: grid; gap: 4px; }
.tile-body .small { display: block; }
.tag {
    display: inline-block; font-size: 0.72em; font-weight: 800; letter-spacing: 0.05em;
    padding: 2px 9px; border-radius: 999px; vertical-align: 1px; border: 1px solid transparent;
}
.tag-stl { background: rgba(93, 180, 217, 0.16); color: #8fd0ea; border-color: rgba(93, 180, 217, 0.45); }
.tag-3mf { background: rgba(238, 58, 59, 0.16); color: #ff9d9d; border-color: rgba(238, 58, 59, 0.5); }
.tag-zip { background: rgba(255, 176, 32, 0.15); color: #ffcf6b; border-color: rgba(255, 176, 32, 0.5); }

/* Per-item preview galleries (upload page + print page) */
.preview-gallery, .thumb-strip {
    display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 12px;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.preview-slide { margin: 0; flex: 0 0 82%; max-width: 430px; scroll-snap-align: start; }
@media (min-width: 700px) { .preview-slide { flex-basis: 46%; } }
.preview-slide img {
    width: 100%; height: auto; display: block;
    border-radius: var(--r-md); border: 1px solid var(--border); background: var(--img-bg);
}
.preview-slide figcaption { color: var(--muted); font-size: 0.88em; margin-top: 6px; text-align: center; font-weight: 600; }
.slide-controls { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* Print detail */
.preview-box img { max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--border); }
.viewer { height: clamp(280px, 58vh, 460px); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: var(--img-bg); touch-action: none; box-shadow: var(--shadow-sm); }
.viewer canvas { display: block; }
.viewer-msg { padding: 16px; }
.request-photo { max-width: 340px; width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--border); display: block; }

/* Admin requests */
.request { border-top: 1px solid var(--border); padding: 18px 0; }
.request:first-of-type { border-top: 0; padding-top: 6px; }
.request-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge { font-size: 0.78em; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #3d4b5f; color: #fff; text-transform: capitalize; }
.badge-new { background: var(--accent); }
.badge-contacted { background: #b97a0c; }
.badge-printing { background: #2563eb; }
.badge-done { background: #1d9e57; }
.badge-declined { background: #5b6a7d; }

/* Upload page (modern dropzone) */
.upload-card { padding: 28px; }
.dropzone {
    position: relative; cursor: pointer; text-align: center;
    border: 2px dashed rgba(93, 180, 217, 0.45); border-radius: var(--r-lg);
    background: linear-gradient(180deg, rgba(20, 76, 103, 0.28), rgba(20, 76, 103, 0.08));
    padding: 34px 18px;
    transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.dropzone:hover { border-color: rgba(93, 180, 217, 0.85); }
.dropzone.dragging { border-color: var(--amber); background: rgba(255, 176, 32, 0.09); transform: scale(1.012); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-inner { pointer-events: none; display: grid; gap: 5px; justify-items: center; }
.dropzone-icon {
    width: 54px; height: 54px; border-radius: 16px; color: #fff;
    background: linear-gradient(145deg, var(--teal-mid), var(--teal));
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); margin-bottom: 6px;
}
.dropzone-icon svg { width: 26px; height: 26px; }
.dropzone-title { font-weight: 800; font-size: 1.16em; margin: 0; }
.dropzone-browse { color: var(--teal-bright); text-decoration: underline; font-weight: 700; }
.dropzone-file { color: #8be9b0; font-weight: 700; margin: 6px 0 0; word-break: break-all; }
.dropzone-file::before { content: '✓ '; }

/* Upload progress */
.upload-progress { display: grid; gap: 6px; }
.progress-track { background: var(--surface-inset); border: 1px solid var(--border); border-radius: 999px; height: 14px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--teal-bright)); transition: width 0.15s ease; }

/* Idea search (request page) */
.idea-search { display: flex; gap: 10px; margin: 12px 0 6px; }
.idea-search input { flex: 1; min-width: 0; width: auto; }
.idea-results { display: flex; gap: 12px; overflow-x: auto; padding: 8px 2px 12px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
.idea-results:empty { padding: 0; }
.idea-card {
    flex: 0 0 232px; scroll-snap-align: start; display: grid; gap: 7px; align-content: start;
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px;
    transition: border-color var(--ease), transform 0.12s ease;
}
.idea-card:hover { border-color: rgba(93, 180, 217, 0.5); transform: translateY(-2px); }
.idea-card a { color: var(--text); text-decoration: none; display: grid; gap: 7px; }
.idea-card img { width: 100%; height: 172px; object-fit: cover; border-radius: var(--r-sm); background: var(--img-bg); display: block; }
.idea-card strong { font-size: 0.93em; line-height: 1.3; }
.idea-card .btn { margin-top: 2px; }

/* CAPTCHA + honeypot */
.captcha-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.captcha-img { width: 176px; height: 56px; border-radius: var(--r-sm); border: 1px solid var(--border); background: #0d1420; }
.captcha-row input { flex: 1; min-width: 150px; width: auto; }
.hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Legal pages (privacy, terms) */
.legal { line-height: 1.65; }
.legal h1 { margin: 0 0 4px; font-size: 1.7em; }
.legal h2 { margin: 22px 0 6px; font-size: 1.15em; color: var(--text); }
.legal p { margin: 6px 0; color: var(--muted); }
.legal p strong { color: var(--text); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
