/*
Theme Name: ABRC Studio
Theme URI: https://abrcstudio.com
Author: ABRC Technologies
Author URI: https://abrctech.com
Description: A calm single-page storefront for made-to-order T-shirts and mugs. Floating header, light and dark mode, orders by email.
Version: 1.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: abrc-studio
*/

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --bg-alt: #f5f5f7;
    --tile: #f5f5f7;
    --card: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --line: rgba(0, 0, 0, 0.1);
    --btn: #0071e3;
    --btn-hover: #0077ed;
    --link: #0066cc;
    --glass: rgba(255, 255, 255, 0.72);
    --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.18);
    --radius: 22px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --header-offset: 88px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --bg-alt: #0d0d0f;
        --tile: #1c1c1e;
        --card: #1c1c1e;
        --text: #f5f5f7;
        --muted: #a1a1a6;
        --line: rgba(255, 255, 255, 0.14);
        --link: #2997ff;
        --glass: rgba(28, 28, 30, 0.72);
        --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.7);
    }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--header-offset);
    overflow-x: clip;
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.47;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

h1, h2, h3, h4, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }

.wrap {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

:where(a, button):focus-visible {
    outline: 2px solid var(--btn);
    outline-offset: 3px;
    border-radius: 8px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--btn);
    color: #fff;
    border-radius: 10px;
    transform: translateY(-200%);
    transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--btn);
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.98); }

.btn.small { min-height: 36px; padding: 0 18px; font-size: 14px; }

.btn.ghost { background: transparent; color: var(--link); padding-inline: 12px; }
.btn.ghost:hover { background: transparent; text-decoration: underline; }

/* ==========================================================================
   Floating header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 12px;
    z-index: 100;
    width: min(1040px, calc(100% - 24px));
    margin: 12px auto 0;
}
body.admin-bar .site-header { top: 44px; }
@media (max-width: 782px) { body.admin-bar .site-header { top: 58px; } }

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 8px 8px 18px;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-mark { width: 26px; height: 26px; border-radius: 7px; }

.nav { display: flex; gap: 28px; }
.nav a { color: var(--text); opacity: 0.78; font-size: 14px; transition: opacity 0.2s ease; }
.nav a:hover { opacity: 1; }

@media (max-width: 720px) { .nav { display: none; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
    text-align: center;
    padding: clamp(64px, 12vw, 130px) 0 0;
}

.eyebrow {
    font-size: clamp(15px, 2vw, 19px);
    font-weight: 600;
    color: var(--muted);
}

.hero h1 {
    max-width: 14ch;
    margin: 10px auto 18px;
    font-size: clamp(42px, 8.5vw, 88px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.04;
    text-wrap: balance;
}

.lead {
    max-width: 30ch;
    margin-inline: auto;
    font-size: clamp(19px, 2.6vw, 26px);
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--muted);
    text-wrap: balance;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    margin-top: 30px;
}

.hero-art {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(0px, 3vw, 36px);
    margin-top: clamp(40px, 7vw, 72px);
    padding: clamp(28px, 5vw, 56px) 20px;
    background: var(--tile);
    border-radius: 32px;
}
.hero-art .tee { width: min(46%, 340px); }
.hero-art .mug { width: min(30%, 220px); margin-bottom: 7px; }
.nw { white-space: nowrap; }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: clamp(60px, 9vw, 104px) 0; }
.section.alt { background: var(--bg-alt); }

.h2 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
}

.sub {
    max-width: 40ch;
    margin-top: 10px;
    font-size: clamp(17px, 2vw, 21px);
    color: var(--muted);
    line-height: 1.35;
}

/* Products */
.group {
    margin: 52px 0 18px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

.card {
    display: flex;
    flex-direction: column;
    background: var(--tile);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: center;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.art {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 12%;
}
.art svg { width: 100%; height: auto; }
.art img { width: 100%; height: 100%; margin: -12%; object-fit: cover; transform: scale(1.0); }

.info { padding: 0 20px 26px; }
.name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance; }
.price { margin: 4px 0 16px; color: var(--muted); font-size: 17px; }

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 44px;
}

.step {
    padding: 34px 28px;
    background: var(--card);
    border-radius: var(--radius);
}

.num {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
    background: var(--text);
    color: var(--bg);
    border-radius: 50%;
    font-size: 15px;
    font-weight: 600;
}

.step h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.step p { color: var(--muted); }

/* Contact */
.contact { text-align: center; }
.contact .sub { margin-inline: auto; }
.contact .actions { margin-top: 28px; }
.contact-line { margin-top: 18px; color: var(--muted); font-size: 15px; }
.contact-line a { font-weight: 500; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    padding: 28px 0 40px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--text); }

/* ==========================================================================
   Scroll reveal (classes are added by JS, so content shows without it)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }
.card.reveal.in { transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s ease, box-shadow 0.35s ease; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

@media (max-width: 480px) {
    .hero-art { border-radius: 24px; }
    .hero-art .tee { width: 52%; }
    .hero-art .mug { width: 32%; }
    .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .info { padding: 0 12px 20px; }
    .name { font-size: 16px; }
    .price { font-size: 15px; }
}

/* ==========================================================================
   Designer, order bar and dialogs
   ========================================================================== */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.4; margin-top: 10px; }
.msg { color: #d70015; font-size: 14px; line-height: 1.4; }
@media (prefers-color-scheme: dark) { .msg { color: #ff6961; } }

.btn.secondary { background: var(--tile); color: var(--text); }
.btn.secondary:hover { background: var(--line); }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--link); font: inherit; font-size: 14px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.order-bar { position: fixed; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 90; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.order-bar .btn { pointer-events: auto; box-shadow: var(--shadow); min-height: 48px; }
body.has-bar { padding-bottom: 84px; }

.dlg { width: min(960px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 28px; background: var(--bg); color: var(--text); box-shadow: var(--shadow); overflow: auto; }
.dlg[open] { display: flex; flex-direction: column; }
#cartDlg { width: min(640px, calc(100% - 24px)); }
.dlg::backdrop { background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body:has(dialog[open]) { overflow: hidden; }

.dlg-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 28px; background: var(--bg); border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--tile); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }
.dlg-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; background: var(--bg); border-top: 1px solid var(--line); margin-top: auto; }

.dd-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 24px 28px; }
.dd-preview { position: sticky; top: 76px; align-self: start; }
#ddCanvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: 22px; touch-action: none; cursor: grab; background: var(--tile); }
#ddCanvas.dragging { cursor: grabbing; }
.dd-controls { display: grid; gap: 18px; align-content: start; }

.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 600; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
	width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); font: inherit; font-size: 16px;
}
.field textarea { resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--btn); outline-offset: 1px; }
.field input[type="range"] { width: 100%; accent-color: var(--btn); }

.stepper { display: inline-flex; align-items: center; align-self: start; width: max-content; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { width: 44px; height: 40px; border: 0; background: transparent; color: var(--text); font-size: 20px; cursor: pointer; }
.stepper button:hover { background: var(--tile); }
.stepper output { min-width: 34px; text-align: center; font-weight: 600; }
.stepper.small button { width: 32px; height: 30px; font-size: 17px; }
.stepper.small output { min-width: 26px; font-size: 14px; }

.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-row button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--tile); font-size: 20px; cursor: pointer; }
.emoji-row button:hover { background: var(--line); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.swatch[aria-checked="true"] { outline: 2px solid var(--btn); outline-offset: 3px; }

.file-row { display: flex; align-items: center; gap: 14px; }

.cart-body { padding: 20px 28px 28px; }
.cart-list { display: grid; gap: 14px; }
.ci { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ci img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; background: var(--tile); }
.ci-mid { display: grid; gap: 2px; min-width: 0; }
.ci-mid strong { font-weight: 600; }
.ci-meta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.ci-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.ci-price { font-weight: 600; }
.cart-total { display: flex; justify-content: space-between; margin: 16px 0 4px; font-size: 19px; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.form .wide { grid-column: 1 / -1; }
.form .btn.wide { width: 100%; }
.form progress { grid-column: 1 / -1; width: 100%; height: 8px; accent-color: var(--btn); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.done { text-align: center; padding: 48px 28px; display: grid; gap: 14px; justify-items: center; }
.done h3 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.done p { color: var(--muted); max-width: 36ch; }

@media (max-width: 640px) {
	.dlg { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
	.dd-body { grid-template-columns: 1fr; gap: 18px; padding: 16px 20px; }
	.dd-preview { position: static; }
	.form { grid-template-columns: 1fr; }
	.cart-body { padding: 16px 20px 24px; }
	.dlg-head { padding-left: 20px; }
}

/* ==========================================================================
   Logo
   ========================================================================== */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
	.logo-light { display: none; }
	.logo-dark { display: block; }
}
.brand-logo img { height: 22px; width: auto; }
.brand-word { color: #ff8800; font-weight: 600; letter-spacing: 0.16em; font-size: 15px; margin-left: -2px; }
.hero-logo { margin: 0 auto 28px; width: min(300px, 62%); }
.hero-logo img { width: 100%; height: auto; }
@media (max-width: 480px) {
	.brand-logo img { height: 19px; }
	.brand-word { font-size: 14px; letter-spacing: 0.12em; }
}
