/* AveLynx swag store. Premium, editorial, dark. Near-black ground, silver and white type, and one accent: red,
   taken from the slash in the AveLynx logo. System fonts only: nothing is loaded from another site.
   Text is never smaller than 16px. Nothing moves unless the visitor has not asked for less motion. */

:root {
  --bg: #0a0a0b;
  --bg-shift: #101014;
  --hero-top: #17171b;
  --surface: #131316;
  --surface-2: #1b1b1f;
  --tile: #202024;
  --line: #2e2e33;
  --line-strong: #77777f;
  --text: #f5f5f6;
  --silver: #d6d8dd;
  --muted: #b0b2ba;
  --red: #c40018;          /* fills: buttons, marks. White text on it passes AA. */
  --red-hover: #e0001d;
  --red-press: #a80014;
  --red-text: #ff5a5f;     /* red as text or a thin line on near-black. Passes AA on every dark surface below. */
  --danger-bg: #2b0a0f;
  --danger-text: #ffd9db;
  --focus: #ffffff;
  --radius: 4px;
  --font: 'Helvetica Neue', Helvetica, Arial, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wrap: 1440px;
  --gutter: clamp(1rem, 4vw, 3rem);
}

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

html { font-size: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--bg-shift) 0%, var(--bg) 45%, var(--bg-shift) 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem; /* 16px, the smallest allowed anywhere in the store */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* The hidden attribute always wins: a button with its own display rule must not show when it is hidden */
[hidden] { display: none !important; }

main { flex: 1 0 auto; }
main:focus { outline: none; }

img { max-width: 100%; height: auto; }

a { color: var(--red-text); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* Keyboard focus: a white ring with a red ring inside it. White shows on the dark page and on red buttons;
   the red ring shows on the dark page. Never red on dark red. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--red);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--focus);
  font-weight: 700;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap > .message:first-of-type { margin-top: 1.5rem; }
.section { padding-top: clamp(2.5rem, 5.5vw, 4.5rem); padding-bottom: clamp(2rem, 4.5vw, 3.5rem); }
.section + .section { border-top: 1px solid var(--line); }
.section-alt { background: var(--surface); border-bottom: 1px solid var(--line); }
.section-alt + .section { border-top: 0; }
.page { padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: clamp(3rem, 7vw, 6rem); }
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.prose h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }

/* Staging only: a plain text notice at the very top of every page, added by the Worker */
.env-banner {
  margin: 0;
  padding: 12px var(--gutter);
  background: var(--surface-2);
  color: var(--text);
  border-bottom: 3px solid var(--red-text);
  font-size: 1.125rem;
  text-align: center;
}

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 14px var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: 0.14em; text-transform: uppercase; }
.brand img { width: 56px; height: auto; display: block; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-block;
  min-height: 48px;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1rem;
  line-height: 1.7;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--red-text); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red-text); }
@media (max-width: 600px) {
  .env-banner { padding: 8px 12px; font-size: 1rem; line-height: 1.35; }
  .site-header { gap: 6px 8px; padding: 8px 12px; }
  .brand { gap: 8px; min-height: 44px; font-size: 1rem; letter-spacing: 0.06em; }
  .brand img { width: 40px; }
  .site-nav ul { gap: 2px 2px; }
  .site-nav a { min-height: 44px; padding: 10px 6px; letter-spacing: 0.01em; font-size: 1rem; line-height: 1.35; white-space: nowrap; }
}
@media (max-width: 420px) {
  .brand { gap: 0; min-width: 44px; }
  .brand span { display: none; }
}

/* Type */
h1, h2, h3 { font-family: var(--font); text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.15; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.375rem, 2.2vw, 1.625rem); }
h3 { font-size: 1.125rem; line-height: 1.3; letter-spacing: 0.05em; }
p { margin: 0 0 1em; }
.eyebrow { display: block; margin: 0 0 1rem; color: var(--red-text); font-weight: 800; font-size: 1rem; letter-spacing: 0.22em; text-transform: uppercase; }
.lead { color: var(--silver); max-width: 40rem; font-size: 1.125rem; }
.hint { display: block; color: var(--muted); font-size: 1rem; margin: 2px 0 6px; }
.loading { color: var(--muted); }

/* Hero: full width, one headline, one primary button */
.hero {
  border-bottom: 1px solid var(--line);
  /* Layered, no images: a faint fine grid, a soft red glow low on the right, and a charcoal-to-black tone */
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 56px 56px,
    radial-gradient(ellipse 60% 70% at 78% 105%, rgba(196, 0, 24, 0.22), transparent 70%),
    linear-gradient(180deg, var(--hero-top) 0%, var(--bg) 85%);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  min-height: min(68vh, 640px);
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
.hero h1 { font-size: clamp(3rem, 9vw, 7.5rem); line-height: 0.92; letter-spacing: 0; margin-bottom: 0.3em; }
.hero p { color: var(--silver); font-size: clamp(1.125rem, 2vw, 1.5rem); max-width: 30rem; margin-bottom: 2rem; }
/* A quiet supporting mark, about 40 percent smaller than before, softened so it does not compete with the headline */
.hero-mark { display: block; width: 100%; max-width: 330px; height: auto; margin-left: auto; opacity: 0.78; filter: drop-shadow(0 0 36px rgba(196, 0, 24, 0.2)); }
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; min-height: 0; }
  .hero-mark { order: -1; max-width: 140px; margin: 0; }
}

/* Buttons */
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 30px;
  border-radius: var(--radius);
  border: 2px solid var(--red);
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--red-hover); border-color: var(--red-hover); }
.button:active, button:active { background: var(--red-press); border-color: var(--red-press); }
.button.large { min-height: 60px; padding: 16px 40px; font-size: 1.125rem; }
button[disabled] { opacity: 0.55; cursor: not-allowed; }
.button.secondary, button.secondary { background: transparent; border-color: var(--line-strong); color: var(--text); }
.button.secondary:hover, button.secondary:hover { background: var(--surface-2); border-color: var(--silver); }
.button.danger, button.danger { background: transparent; border-color: var(--line-strong); color: var(--red-text); }
.button.danger:hover, button.danger:hover { background: var(--danger-bg); border-color: var(--red-text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Messages. Errors are announced and stay until the visitor changes something: nothing dismisses itself. */
.message { padding: 14px 18px; margin: 0 0 20px; border: 2px solid var(--line-strong); background: var(--surface-2); color: var(--text); }
.message[hidden] { display: none; }
.message.error { background: var(--danger-bg); border-color: var(--red-text); color: var(--danger-text); }
.message.ok { border-color: var(--silver); }
.message.note { border-color: var(--line-strong); color: var(--silver); }
.message:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.message a { color: inherit; font-weight: 700; }

/* Fields */
.field { margin: 0 0 20px; max-width: 34rem; }
.field label, .field .label, legend { display: block; font-weight: 700; margin-bottom: 4px; }
input[type="text"], input[type="email"], input[type="number"], input[type="tel"], select, textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
}
textarea { min-height: 120px; }
input[type="checkbox"] { width: 24px; height: 24px; vertical-align: middle; margin-right: 10px; accent-color: var(--red); }
.checkbox-field label { display: inline; }
fieldset { border: 1px solid var(--line); padding: 16px 20px; margin: 0 0 22px; max-width: 40rem; }
fieldset.plain { border: 0; padding: 0; }

/* Photo tiles. A real photo fills the frame; a stand-in is a flat grey tile with the product name, plainly not a picture. */
.media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; background: var(--tile); overflow: hidden; }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  height: 100%;
  padding: 1.25rem;
  background: var(--tile);
  color: var(--silver);
  text-align: center;
}
.tile-name { font-size: clamp(1.125rem, 1.4vw, 1.25rem); font-weight: 700; line-height: 1.15; text-transform: uppercase; letter-spacing: 0.03em; overflow-wrap: break-word; }
.tile-note { font-size: 1rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
/* Small tiles (thumbnails, cart): the name is already written next to them, so the tile stays a plain flat square */
.tile.small .tile-name, .tile.small .tile-note { display: none; }

/* Product grid: tiles spread evenly across the width (4 or more fill rows on a desktop, 2 on a tablet, 1 on a phone) */
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: clamp(1.25rem, 2.2vw, 2rem); margin: 0; padding: 0; list-style: none; }
.product-grid:has(> :only-child) .card { max-width: 26rem; }

.card { position: relative; background: transparent; }
.card .media { border: 1px solid var(--line); }
.card-body { padding: 14px 2px 0; }
.card-collection { margin: 0 0 4px; color: var(--muted); font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; }
.card-title { margin: 0 0 4px; font-size: 1.0625rem; }
.card-title a { color: var(--text); text-decoration: none; }
/* The whole card is one link: this stretches the product name's link over the card */
.card-title a::after { content: ''; position: absolute; inset: 0; }
.card:hover .media, .card:has(a:focus-visible) .media { border-color: var(--silver); }
.card:hover .card-title a { text-decoration: underline; text-underline-offset: 5px; }
.price { margin: 0; font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.02em; }
/* "Sold out" is always written in words (never just a colour) */
.card-status, .stock-note { margin: 0 0 4px; color: var(--red-text); font-weight: 800; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; }
.stock-note { margin: 0 0 14px; text-transform: none; letter-spacing: 0.02em; font-size: 1.125rem; }
.card .card-title a:focus-visible { outline-offset: 4px; }

/* Collections on the home page (only shown when products have a collection) */
.collection-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: clamp(1rem, 2vw, 1.5rem); margin: 0; padding: 0; list-style: none; }
.collection-link {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 150px;
  padding: 20px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-left: 6px solid var(--red);
  color: var(--text);
  text-decoration: none;
}
.collection-link:hover { border-color: var(--silver); border-left-color: var(--red-text); }
.collection-link[aria-current="true"] { border-color: var(--silver); border-left-color: var(--red-text); }
.collection-name { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1; }
.collection-count { color: var(--muted); font-size: 1rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 1.75rem; padding-bottom: 0.875rem; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; }

/* Product page */
.product-detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
@media (max-width: 860px) { .product-detail { grid-template-columns: 1fr; } }
.gallery .media { max-height: 80vh; border: 1px solid var(--line); }
.gallery .tile-name { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
.thumbs { display: flex; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; overflow-x: auto; padding-bottom: 6px; }
.thumbs li { flex: 0 0 auto; }
.thumb {
  display: block;
  width: 84px;
  height: 104px;
  min-height: 0;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--tile);
  overflow: hidden;
}
.thumb:hover, .thumb:active { background: var(--tile); border-color: var(--silver); }
.thumb[aria-pressed="true"] { border-color: var(--text); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.buy .eyebrow { margin-bottom: 0.5rem; }
.buy h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
.buy .price { font-size: 1.375rem; margin-bottom: 1.25rem; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 52px;
  padding: 10px 18px;
  margin: 0;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.choice label:hover { border-color: var(--silver); }
.choice input:checked + label { background: var(--text); border-color: var(--text); color: var(--bg); }
.choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 3px var(--red); }
.details { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.details h2 { font-size: 1.25rem; letter-spacing: 0.1em; }
.details ul { margin: 0 0 1em; padding-left: 1.25em; color: var(--silver); }
.details li { margin-bottom: 0.4em; }

/* Tables (cart, orders, admin) */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 0 10px; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { color: var(--muted); font-weight: 700; font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; }
td input[type="number"] { width: 6rem; }
.cart-item { display: flex; align-items: center; gap: 14px; min-width: 14rem; }
.cart-thumb { flex: 0 0 64px; width: 64px; height: 80px; }
.cart-thumb .media { height: 100%; aspect-ratio: auto; }
.cart-summary { max-width: 28rem; margin-left: auto; padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.cart-summary dl { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 12px; font-size: 1.5rem; font-weight: 800; }
.cart-summary dt, .cart-summary dd { margin: 0; }
.cart-summary .actions .button, .cart-summary .actions button { flex: 1 1 100%; }

.order { background: var(--surface); border: 1px solid var(--line); padding: 16px 20px; margin: 0 0 16px; }
.order h3 { margin-top: 0; }
.order ul { margin: 6px 0; padding-left: 22px; }

/* Staff orders page */
.order-detail { margin-top: 2.5rem; padding: clamp(1rem, 3vw, 1.75rem); background: var(--surface); border: 1px solid var(--line); }
.order-detail h2 { margin-top: 0; overflow-wrap: anywhere; }
.order-detail h3 { margin-top: 1.75rem; }
.facts { display: grid; gap: 10px; margin: 0 0 1rem; }
.fact { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 4px 16px; }
.fact dt { color: var(--muted); font-weight: 700; }
.fact dd { margin: 0; overflow-wrap: anywhere; }
address { font-style: normal; margin: 0 0 1rem; }
@media (max-width: 640px) { .fact { grid-template-columns: 1fr; } }

#signed-in h2, #form-heading { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }

/* Footer */
/* One slim row, about 64px tall on a desktop; it stacks on a phone. Text stays 16px. */
.site-footer { margin-top: 2.5rem; padding: 10px var(--gutter); background: var(--surface); border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; line-height: 1.4; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; max-width: var(--wrap); margin: 0 auto; min-height: 44px; }
.footer-brand { margin: 0; color: var(--text); font-weight: 800; font-size: 1rem; letter-spacing: 0.22em; text-transform: uppercase; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.site-footer a { display: inline-block; padding: 8px 0; color: var(--silver); }
.site-footer a:hover { color: var(--text); }
.footer-small { margin: 0; flex: 0 1 auto; }
@media (max-width: 760px) {
  .site-footer { padding: 14px var(--gutter); }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 6px; min-height: 0; }
  .site-footer ul { gap: 2px 18px; }
}

/* Motion. Only for people who have not asked for less of it. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .button, button, .site-nav a, .collection-link, .thumb, .choice label, .card .media { transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.22s ease; }
  .card { transition: transform 0.22s ease; }
  .card:hover, .card:has(a:focus-visible) { transform: translateY(-6px); }
  .collection-link:hover { transform: translateY(-3px); }
}

/* If the visitor asks for less motion, nothing animates, transitions or scrolls smoothly, whatever is written above */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover, .card:has(a:focus-visible), .collection-link:hover { transform: none !important; }
}

@media (forced-colors: active) {
  .message, .card .media, .order, input, select, textarea, button, .button, .choice label, .collection-link, .tile { border: 2px solid CanvasText; }
  .choice input:checked + label { outline: 3px solid Highlight; }
}
