@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap');

:root {
    --accent: #2563EB;
    --warm: #F97316;
    --bg: #ffffff;
    --bg-muted: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --radius: 1rem;
}

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

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Instrument Sans', sans-serif; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 980px; margin: 0 auto; padding: 0 1.25rem; }

/* NAVIGATION */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid rgba(0,0,0,.05); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: 48px; }
.nav-logo { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.logo-dwarf { color: var(--text); }
.logo-cray { color: var(--accent); }
.nav-links { display: none; align-items: center; gap: 0; flex: 1; justify-content: center; }
.nav-links a { padding: 4px 12px; font-size: 12px; color: var(--text-muted); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); font-weight: 500; }
.nav-right { display: flex; align-items: center; }
.mobile-toggle { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; }
.mobile-menu { display: none; border-top: 1px solid var(--border-color); background: rgba(255,255,255,.95); backdrop-filter: blur(20px); padding: 0.5rem 1.25rem; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 10px 8px; font-size: 14px; color: var(--text-muted); }
.mobile-menu a:hover, .mobile-menu a.active { color: var(--text); font-weight: 500; }
@media (min-width: 768px) { .nav-links { display: flex; } .mobile-toggle { display: none; } }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; font-size: 14px; font-weight: 500; font-family: inherit; border-radius: 9999px; border: 1px solid transparent; cursor: pointer; transition: all .2s; text-decoration: none; line-height: 1.4; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #1d4ed8; }
.btn-warm { background: var(--warm); color: #fff; }
.btn-warm:hover { background: #ea580c; }
.btn-lg { padding: 12px 28px; font-size: 14px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-secondary { background: var(--bg-muted); color: var(--text); border-color: var(--border-color); }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn-outline:hover { background: rgba(255,255,255,.1); }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; font-size: 9px; font-weight: 600; font-family: inherit; border-radius: 9999px; line-height: 1.5; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-accent { background: rgba(37,99,235,.1); color: var(--accent); }
.badge-warm { background: var(--warm); color: #fff; }
.badge-secondary { background: var(--bg-muted); color: var(--text-muted); border: 1px solid var(--border-color); }

/* CARDS */
.card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.04); }
.card-body { padding: 1rem; }
.card-body-lg { padding: 1.5rem; }

/* HERO */
.hero-fullscreen { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.hero-fullscreen .hero-bg { position: absolute; inset: 0; background: #000; }
.hero-fullscreen .hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.hero-center { position: relative; z-index: 10; padding: 2rem 1.25rem; max-width: 640px; }
.hero-center h1 { font-size: 48px; font-weight: 600; color: #fff; line-height: 1.05; letter-spacing: -0.02em; }
.hero-sub { margin-top: 1.5rem; color: rgba(255,255,255,.6); font-size: 18px; max-width: 480px; margin-left: auto; margin-right: auto; }
@media (min-width: 640px) { .hero-center h1 { font-size: 64px; } }
@media (min-width: 1024px) { .hero-center h1 { font-size: 80px; } }

.hero-species { position: relative; min-height: 70vh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-species .hero-bg { position: absolute; inset: 0; background: #000; }
.hero-species .hero-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.75; }
.hero-bottom { position: relative; z-index: 10; width: 100%; max-width: 980px; margin: 0 auto; padding: 0 1.25rem 5rem; }
.hero-bottom h1 { font-size: 48px; font-weight: 600; color: #fff; line-height: 1.05; letter-spacing: -0.02em; }
.hero-bottom .hero-sub { margin-top: 0.75rem; color: rgba(255,255,255,.5); font-size: 18px; max-width: 480px; }
.hero-sci { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(147,197,253,.6); margin-bottom: 1rem; }
@media (min-width: 640px) { .hero-bottom h1 { font-size: 64px; } }

/* SECTIONS */
.section { padding: 4rem 0; }
.section-lg { padding: 6rem 0; }
.porcelain-gradient { background: linear-gradient(180deg, rgba(219,234,254,.3) 0%, rgba(219,234,254,.1) 100%); }

/* GRID */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* SPECIES LINK */
.species-link { display: block; text-align: left; transition: transform .2s; }
.species-link:hover { transform: translateY(-2px); }
.species-link .img-aspect-sq { border-radius: var(--radius); overflow: hidden; }

/* SPECIES/COLOR SELECTOR */
.species-selector, .color-selector { display: block; width: 100%; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); cursor: pointer; text-align: left; overflow: hidden; transition: all .2s; font-family: inherit; padding: 0; }
.species-selector:hover, .color-selector:hover { border-color: rgba(37,99,235,.4); }
.species-selector.selected, .color-selector.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.species-selector img, .color-selector img { width: 100%; height: 100%; object-fit: cover; }
.overlay-badge { position: absolute; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; }

/* PACK LIST */
.pack-list { display: flex; flex-direction: column; gap: 0.75rem; }
.pack-row { display: flex; align-items: center; gap: 1rem; background: var(--card-bg); border-radius: var(--radius); padding: 1rem 1.25rem; border: 1px solid var(--border-color); transition: all .2s; text-decoration: none; color: inherit; }
.pack-row:hover { border-color: rgba(37,99,235,.4); }
.pack-row.best { border-color: rgba(249,115,22,.3); }
.pack-row.best:hover { border-color: rgba(249,115,22,.6); }
.pack-row.disabled { opacity: 0.5; cursor: not-allowed; }
.pack-img { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--bg-muted); flex-shrink: 0; }
.pack-img img { width: 100%; height: 100%; object-fit: cover; }
.pack-info { flex: 1; min-width: 0; }
.pack-price { flex-shrink: 0; text-align: right; }

/* PRICE TABLE */
.price-table { border-radius: var(--radius); overflow: hidden; }
.price-header { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px 20px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border-color); background: rgba(219,234,254,.3); }
.price-row { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px 20px; font-size: 14px; border-bottom: 1px solid rgba(226,232,240,.5); align-items: center; }
.price-row:last-child { border-bottom: none; }
.price-row.best-value { background: rgba(249,115,22,.03); }

/* SPEC TABLE */
.spec-table { font-size: 14px; }
.spec-row { display: flex; justify-content: space-between; padding: 10px 0; gap: 1rem; border-bottom: 1px solid var(--border-color); }
.spec-row:last-child { border-bottom: none; }

/* IMAGE GRID */
.img-grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.img-aspect-34 { aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; background: var(--bg-muted); }
.img-aspect-sq { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--bg-muted); }
.img-aspect-43 { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: var(--bg-muted); }
.img-aspect-43 img, .img-aspect-34 img, .img-aspect-sq img { width: 100%; height: 100%; object-fit: cover; }

/* TWO COLUMN LAYOUT */
.two-col { display: grid; gap: 3rem; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ICON BOX */
.icon-box { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(37,99,235,.1); color: var(--accent); flex-shrink: 0; font-size: 14px; font-weight: 700; }

/* FOOTER */
.footer { background: var(--bg-muted); border-top: 1px solid var(--border-color); }
.footer-inner { padding: 2.5rem 0; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; font-size: 12px; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand .logo-dwarf, .footer-brand .logo-cray { font-size: 16px; font-weight: 600; }
.footer-brand p { color: var(--text-muted); line-height: 1.6; max-width: 180px; margin-top: 0.75rem; }
.footer h4 { font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 6px; }
.footer ul a { color: var(--text-muted); transition: color .2s; }
.footer ul a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border-color); margin-top: 1.5rem; padding-top: 1rem; font-size: 11px; color: var(--text-muted); }

/* ACCORDION */
.accordion-item { border-bottom: 1px solid var(--border-color); }
.accordion-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 1rem 0; background: none; border: none; cursor: pointer; text-align: left; font-size: 14px; font-weight: 500; font-family: inherit; color: var(--text); }
.accordion-trigger::after { content: "+"; font-size: 1.25rem; color: var(--text-muted); transition: transform .2s; flex-shrink: 0; margin-left: 1rem; }
.accordion-trigger.open::after { content: "\2212"; }
.accordion-content { display: none; padding: 0 0 1rem; font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.accordion-content.open { display: block; }

/* ADMIN */
.admin-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.admin-header h1 { font-size: 1.25rem; font-weight: 700; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.admin-stat { text-align: center; padding: 1rem; }
.admin-stat .num { font-size: 1.5rem; font-weight: 700; }
.admin-stat .label { font-size: 0.75rem; color: var(--text-muted); }
.admin-product { display: flex; align-items: start; gap: 1rem; padding: 1rem; }
.admin-product .thumb { width: 64px; height: 64px; border-radius: var(--radius); background: var(--bg-muted); overflow: hidden; flex-shrink: 0; }
.admin-product .thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-product .details { flex: 1; min-width: 0; }
.admin-product .details h3 { font-size: 0.875rem; font-weight: 600; }
.admin-product .details .sci { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.admin-product .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.5rem; }
.admin-product .actions { display: flex; gap: 4px; flex-shrink: 0; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 400px; margin: 0 1rem; }
.login-card .card-body { text-align: center; }

/* FORMS */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"], textarea, select {
    width: 100%; padding: 8px 12px; font-size: 14px; font-family: inherit;
    border: 1px solid var(--border-color); border-radius: 8px; background: #fff; color: var(--text);
    transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }

.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.btn-danger { background: #dc2626; color: #fff; border-color: #b91c1c; }
.btn-danger:hover { background: #b91c1c; }

.switch-wrap { display: flex; align-items: center; gap: 0.5rem; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--border-color); border-radius: 12px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* TEXT UTILITIES */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-warm { color: var(--warm); }
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.italic { font-style: italic; }
.leading-relaxed { line-height: 1.7; }

/* SPACING */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }

/* FLEX */
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; } .items-center { align-items: center; }
.items-start { align-items: flex-start; } .justify-between { justify-content: space-between; }
.justify-center { justify-content: center; } .flex-1 { flex: 1; } .shrink-0 { flex-shrink: 0; }

.max-w-3xl { max-width: 768px; } .max-w-2xl { max-width: 640px; } .max-w-xl { max-width: 576px; }
.mx-auto { margin-left: auto; margin-right: auto; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

main {
    animation: page-fade-in 0.35s ease-out both;
}
