/* ARACHNOWEBS — site styles
   Layout: one centered column (max 1120px), two-column hero that stacks on phones.
   Dark is the default look; light mode is switched on by the theme button. */

@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-SemiBold.woff") format("woff"); font-weight: 600 700; font-display: swap; }

@font-face {
  font-family: "Satoshi";
  src: url("fonts/Satoshi-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #000000;
  --surface: #1b1b1f;
  --surface-line: #2a2a30;
  --text: #f5f5f5;
  --muted: #b5b5bd;
  --accent: #ef343d;
  --accent-ink: #ffffff;
  --accent-fill: #d7262f; /* red behind white text: passes 4.5:1 */
  --display: "Satoshi", "Inter", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

:root[data-mode="light"] {
  --bg: #f6f4f3;
  --surface: #ffffff;
  --surface-line: #e4e0de;
  --text: #121214;
  --muted: #55555f;
  --accent: #d9222c;
  --accent-ink: #ffffff;
  --accent-fill: #d9222c;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.02em;
  transition: background-color .25s ease, color .25s ease;
}

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

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: clamp(16px, 5vw, 64px);
}

/* ---------- Header ---------- */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding-block: 24px;
}

.logo img { width: 52px; height: auto; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.logo-word { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .045em; line-height: 1; color: var(--text); }
.kicker-brand { display: none; color: var(--accent); font-weight: 600; margin-right: 6px; }
.kicker-brand::after { content: " ·"; color: var(--muted); }
/* Narrow phones: no room for the wordmark in the header, so show the name above the headline instead */
@media (max-width: 639px) {
  .logo-word { display: none; }
  .kicker-brand { display: inline; }
}
.logo-light { display: none; }
:root[data-mode="light"] .logo-dark { display: none; }
:root[data-mode="light"] .logo-light { display: block; }

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
}

.nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  transition: color .15s ease;
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--accent); }

.theme-toggle {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font: 500 13px/1 var(--body);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.theme-toggle:hover { background: var(--accent-fill); color: var(--accent-ink); }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(40px, 7vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lede, .copy p { color: var(--muted); margin: 0; max-width: 68ch; }

.stack { display: flex; flex-direction: column; gap: 20px; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--accent-fill); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 90%, #000); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent);
}

.text-link {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  align-self: flex-start;
  transition: color .15s ease, border-color .15s ease;
}
.text-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Sections ---------- */
main { display: flex; flex-direction: column; gap: clamp(72px, 10vw, 128px); padding-block: clamp(40px, 7vw, 96px) 0; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.hero .actions { margin-top: 8px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
}

.showcase { margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.showcase figcaption {
  color: var(--muted);
  font-size: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
}

/* ---------- Mockup card (stays dark in both modes; it's a showcase) ---------- */
.mockup {
  /* dark mode (default) */
  --m-from: #1b1b1f;
  --m-to: #431418;
  --m-surface: #1b1b1f;
  --m-text: #f5f5f5;
  --m-muted: #b5b5bd;
  --m-sheen: rgba(255, 150, 160, .32);
  --m-sheen-soft: rgba(255, 80, 92, .10);
  --m-sheen-blend: screen;
  --m-screen-shadow: none;
  --m-ring: rgba(255, 110, 120, .35);
  --panel: linear-gradient(125deg, #111113 0%, #a51d26 45%, #ef343d 60%, #a51d26 78%, #111113 100%);
  /* Fade from the top-left to red at the bottom-right; oversized so it can shift gently */
  background: linear-gradient(135deg, var(--m-from) 0%, var(--m-from) 15%, var(--m-to) 85%, var(--m-to) 100%);
  background-size: 160% 160%;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: frame-drift 9s ease-in-out infinite alternate, frame-glow 4s ease-in-out infinite;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--m-text);
}

.mockup > * { position: relative; z-index: 1; }

/* Wide soft sheen sweeping over the frame, offset from the panel's flash */
.mockup::after {
  content: "";
  position: absolute;
  inset: -30% -70%;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: var(--m-sheen-blend);
  background: linear-gradient(115deg,
    transparent 40%,
    var(--m-sheen-soft) 46%,
    var(--m-sheen) 50%,
    var(--m-sheen-soft) 54%,
    transparent 60%);
  animation: sweep 5.2s cubic-bezier(.45, 0, .25, 1) 1.4s infinite;
}

@keyframes frame-drift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

@keyframes frame-glow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 90, 100, .10), 0 0 0 rgba(239, 52, 61, 0); }
  50%      { box-shadow: inset 0 0 0 1px var(--m-ring), 0 0 32px rgba(239, 52, 61, .18); }
}

.mockup-label {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--m-muted);
}

.mockup-screen {
  background: var(--m-surface);
  box-shadow: var(--m-screen-shadow);
  transition: background-color .25s ease, color .25s ease;
  border-radius: 10px;
  padding: clamp(18px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mockup-screen .kicker { color: var(--m-text); font-size: 11px; font-weight: 600; }

.mockup-screen h2 {
  font-size: clamp(24px, 3vw, 34px);
  color: var(--m-text);
}

/* Light mode: soft white-to-rose frame, white screen, warm red panel */
:root[data-mode="light"] .mockup {
  --m-from: #ffffff;
  --m-to: #f1b6bc;
  --m-surface: #ffffff;
  --m-text: #121214;
  --m-muted: #55555f;
  --m-sheen: rgba(255, 255, 255, .85);
  --m-sheen-soft: rgba(255, 255, 255, .35);
  --m-sheen-blend: normal;
  --m-screen-shadow: 0 1px 2px rgba(18, 18, 20, .06), 0 14px 30px -18px rgba(150, 20, 30, .35);
  --m-ring: rgba(217, 34, 44, .35);
  --panel: linear-gradient(125deg, #6e1219 0%, #b81d28 45%, #ef343d 60%, #c41f2a 78%, #6e1219 100%);
  border: 1px solid #ecd9da;
}

/* The red "enchanted armor" panel.
   Layers: a slowly drifting red gradient, two streaky glint textures scrolling
   at crossing angles (like Minecraft's enchant glint), and one bright sweep. */
.shine-panel {
  position: relative;
  aspect-ratio: 16 / 5;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  background: var(--panel);
  background-size: 220% 220%;
  animation: drift 7s ease-in-out infinite alternate;
  box-shadow: inset 0 0 0 1px rgba(255, 120, 130, .14);
}

@keyframes drift {
  0%   { background-position: 0% 30%; }
  100% { background-position: 70% 70%; }
}

/* Streaky noise textures, rotated to cross each other and scrolled endlessly */
.shine-panel .glint {
  position: absolute;
  inset: -60%;
  pointer-events: none;
  mix-blend-mode: screen;
  background-size: 256px 256px;
}

.shine-panel .g1 {
  background-image: url("glint-a.webp");
  transform: rotate(-32deg);
  animation: scroll 2.8s linear infinite, pulse 2.4s ease-in-out infinite;
}

.shine-panel .g2 {
  background-image: url("glint-b.webp");
  transform: rotate(28deg);
  animation: scroll 4.6s linear infinite reverse, pulse 3.2s ease-in-out -1.3s infinite;
}

@keyframes scroll {
  from { background-position: 0 0; }
  to   { background-position: 256px 0; }
}

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

/* Bright sweep that passes over everything every few seconds */
.shine-panel::after {
  content: "";
  position: absolute;
  inset: -20% -60%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: linear-gradient(115deg,
    rgba(239, 52, 61, 0) 38%,
    rgba(255, 90, 100, .15) 44%,
    rgba(255, 170, 178, .75) 49%,
    rgba(255, 90, 100, .2) 54%,
    rgba(239, 52, 61, 0) 60%);
  animation: sweep 3.6s cubic-bezier(.45, 0, .25, 1) infinite;
}

@keyframes sweep {
  0%   { transform: translateX(-60%); }
  65%  { transform: translateX(60%); }
  100% { transform: translateX(60%); }
}

@media (prefers-reduced-motion: reduce) {
  /* Calmer version instead of none: slow drift and glint, no flashing sweep or pulse */
  .shine-panel { animation-duration: 16s; }
  .shine-panel .g1 { animation: scroll 9s linear infinite; opacity: .8; }
  .shine-panel .g2 { animation: scroll 14s linear infinite reverse; opacity: .7; }
  .shine-panel::after { animation: none; opacity: 0; }
  .mockup { animation: frame-drift 18s ease-in-out infinite alternate; }
  .mockup::after { animation: none; opacity: 0; }
  .btn:hover { transform: none; }
}

/* ---------- Sections ---------- */
.section { display: flex; flex-direction: column; gap: 40px; }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.section-head .kicker { color: var(--accent); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 14px;
  padding: clamp(22px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.card h2, .card h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }

.offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 960px) { .offers { grid-template-columns: minmax(0, 1fr); max-width: 560px; } }

.offer { position: relative; transition: transform .2s ease, border-color .2s ease; }
.offer:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, var(--surface-line)); }
.offer .btn { margin-top: auto; align-self: stretch; }
/* Line up titles and prices across the three cards on wide screens */
@media (min-width: 961px) {
  .offer:not(.featured) h3 { margin-top: 48px; }
  .offer h3 { min-height: 2.4em; display: flex; align-items: flex-end; }
}

.price {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.price span { display: block; margin-top: 8px; font-family: var(--body); font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--muted); letter-spacing: 0; }
.featured .price { color: var(--accent); }

.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { position: relative; padding-left: 28px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0; top: .2em;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.ticks li::after {
  content: "";
  position: absolute;
  left: 6px; top: calc(.2em + 4px);
  width: 5px; height: 9px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.badge {
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.note { margin: 0; color: var(--muted); font-size: 14px; max-width: 68ch; }

/* ---------- Attention: featured card with a slowly travelling glow border ---------- */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.featured {
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--spin),
      var(--surface-line) 0deg, var(--surface-line) 200deg,
      #ff6a72 260deg, var(--accent) 300deg, var(--surface-line) 360deg) border-box;
  box-shadow: 0 18px 50px -24px color-mix(in srgb, var(--accent) 55%, transparent);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { --spin: 360deg; } }

/* ---------- Attention: primary buttons get a soft glow and a passing shine ---------- */
.btn-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  animation: btn-glow 3s ease-in-out infinite;
}
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 45%;
  z-index: -1;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-20deg);
  animation: btn-shine 4s ease-in-out infinite;
}
@keyframes btn-shine {
  0%, 55% { left: -60%; }
  85%, 100% { left: 130%; }
}
@keyframes btn-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  50%      { box-shadow: 0 6px 24px -4px color-mix(in srgb, var(--accent) 60%, transparent); }
}
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 15px; }

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  counter-reset: none;
}
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

.step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 2px solid var(--surface-line);
  min-width: 0;
}
.step:first-child { border-top-color: var(--accent); }
.step h3 { font-size: 19px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.step-n {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- Call-to-action band ---------- */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 40px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--surface) 0%, color-mix(in srgb, var(--accent) 22%, var(--surface)) 100%);
  border: 1px solid var(--surface-line);
}
.cta-band .stack { gap: 10px; max-width: 560px; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }
.contact-card .btn { align-self: flex-start; }
.email-line { margin: 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.email-line strong { color: var(--text); font-weight: 600; }
.email-line a { color: inherit; text-decoration: none; }
.email-line a:hover strong { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(72px, 10vw, 120px); border-top: 1px solid var(--surface-line); }
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px 40px;
  padding-block: 32px 40px;
}
.site-footer .brand { display: flex; align-items: center; gap: 12px; }
.site-footer .brand img { width: 36px; }
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: 0.04em; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-nav a, .foot-contact a { text-decoration: none; font-size: 14px; font-weight: 500; }
.foot-nav a:hover, .foot-contact a:hover { color: var(--accent); }
.foot-contact { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.foot-contact p { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) { .foot-contact { align-items: flex-start; } }

/* ---------- Our work ---------- */
.projects { display: flex; flex-direction: column; gap: clamp(48px, 7vw, 88px); }
.project { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.project:nth-child(even) .shot { order: 2; }
.shot {
  display: block; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--surface-line);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.shot img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.shot:hover { transform: translateY(-6px) rotate(-.4deg); border-color: var(--accent); box-shadow: 0 40px 70px -30px color-mix(in srgb, var(--accent) 45%, transparent); }
.project-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.project-body .kicker { color: var(--accent); font-weight: 600; }
.project-body h2 { font-size: clamp(28px, 3.4vw, 38px); }
.project-body p { margin: 0; color: var(--muted); }
.project-body .btn { align-self: flex-start; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--surface-line); font-size: 13px; font-weight: 500; }
@media (max-width: 860px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .project:nth-child(even) .shot { order: 0; }
}
@media (prefers-reduced-motion: reduce) { .shot:hover { transform: none; } }

/* ---------- Footer legal strip ---------- */
.foot-legal {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-line);
}
.foot-legal p { margin: 0; font-size: 12px; color: var(--muted); max-width: 70ch; }
.foot-legal nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot-legal a { font-size: 13px; }
/* Legally required operator details: quiet, but always readable */
.foot-legal .operator { flex-basis: 100%; margin: 4px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); opacity: .85; }

/* Placeholder text that must be filled in before launch */
mark.todo {
  background: color-mix(in srgb, #ffd23f 30%, transparent);
  color: inherit;
  border-radius: 4px;
  padding: 0 4px;
}

/* ---------- Legal pages ---------- */
.legal { display: flex; flex-direction: column; gap: 40px; max-width: 820px; }
.legal section { display: flex; flex-direction: column; gap: 12px; }
.legal h2 { font-size: 22px; }
.legal p { margin: 0; color: var(--muted); max-width: 72ch; }
.legal a { color: var(--text); text-underline-offset: 3px; }
.legal a:hover { color: var(--accent); }
.legal code { font-size: .9em; background: var(--surface); border: 1px solid var(--surface-line); border-radius: 4px; padding: 1px 5px; }
.legal section:has(table) { overflow-x: auto; }
.legal table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--surface-line); }
.legal th { font-weight: 600; color: var(--text); background: var(--surface); }
.legal td { color: var(--muted); }
.legal td:first-child { color: var(--text); font-weight: 500; }

/* Colour-mode "spill": the new theme grows out of the button (see theme.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }
:root.spilling *, :root.spilling *::before, :root.spilling *::after { transition: none !important; }

/* Light/dark button: icon only (sun in dark mode, moon in light mode) */
.theme-toggle { width: 36px; padding: 0; font-size: 0; display: inline-grid; place-items: center; flex-shrink: 0; }
.theme-toggle::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
:root[data-mode="dark"] .theme-toggle { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cg stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 1v3M12 20v3M1 12h3M20 12h3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1'/%3E%3C/g%3E%3C/svg%3E"); }
:root[data-mode="light"] .theme-toggle { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 14.5A9 9 0 1 1 9.5 3a7 7 0 0 0 11.5 11.5z'/%3E%3C/svg%3E"); }

/* ---------- Mobile menu ---------- */
.nav-links { display: contents; }
.menu-toggle { display: none; }
@media (max-width: 1099px) {
  .site-header { position: relative; z-index: 30; }
  .site-header .wrap { flex-wrap: nowrap; padding-block: 16px; }
  .logo { flex-shrink: 0; }
  .logo img { width: 44px; }
  .nav { flex-wrap: nowrap; justify-content: flex-end; gap: 8px; }
  .nav-links {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    padding: 4px clamp(16px, 5vw, 64px) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--surface-line);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .5);
  }
  .nav.open .nav-links { display: flex; flex-direction: column; }
  .nav-links .nav-link { padding: 14px 4px; font-size: 17px; border-top: 1px solid var(--surface-line); }
  .nav-links .nav-link:first-child { border-top: 0; }
  .menu-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 36px; padding: 0 10px; flex-shrink: 0;
    border: 1px solid var(--surface-line); border-radius: 999px;
    background: var(--surface); cursor: pointer;
  }
  .menu-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s ease, opacity .2s ease; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex; align-items: center;
  height: 36px; padding: 3px;
  border: 1px solid var(--surface-line); border-radius: 999px;
  background: var(--surface);
  text-decoration: none; font: 600 12px/1 var(--body); letter-spacing: .04em;
}
.lang-switch span { display: grid; place-items: center; height: 100%; padding: 0 9px; border-radius: 999px; color: var(--muted); transition: background-color .15s ease, color .15s ease; }
.lang-switch span.on { background: var(--accent-fill); color: var(--accent-ink); }
.lang-switch:hover { border-color: var(--accent); }
.lang-switch:hover span:not(.on) { color: var(--text); }

/* ---------- Order basket ---------- */
.cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--surface-line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 500 13px/1 var(--body);
  cursor: pointer;
  transition: border-color .15s ease;
}
.cart-toggle:hover { border-color: var(--accent); }
.cart-toggle svg { width: 18px; height: 18px; }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--surface-line);
  color: var(--text);
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.cart-toggle.has-items { border-color: var(--accent); }
.cart-toggle.has-items .cart-count { background: var(--accent-fill); color: var(--accent-ink); }
.cart-toggle.bump { animation: bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

.cart-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .55);
  opacity: 0; transition: opacity .25s ease;
}
.cart-scrim.open { opacity: 1; }

.cart-drawer {
  position: fixed; z-index: 50;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  display: flex; flex-direction: column; gap: 18px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  border-left: 1px solid var(--surface-line);
  box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .6);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.cart-drawer.open { transform: translateX(0); }
:root.cart-locked, :root.cart-locked body { overflow: hidden; }

.cart-head { display: flex; align-items: center; justify-content: space-between; }
.cart-head h2 { font-size: 24px; }
.cart-close {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--surface-line); background: var(--surface); color: var(--text);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.cart-close:hover { border-color: var(--accent); }

.cart-deal {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--surface-line));
  font-size: 14px;
}
.cart-deal strong { color: var(--text); }
.cart-deal.is-won { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.cart-meter { height: 6px; border-radius: 999px; background: var(--surface-line); overflow: hidden; }
.cart-meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s ease; }

.cart-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cart-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--surface-line);
}
.cart-list li div { display: flex; flex-direction: column; min-width: 0; }
.cart-list li span { color: var(--muted); font-size: 13px; }
.cart-list strong { font-weight: 600; }
.cart-price { color: var(--text) !important; font-size: 15px !important; font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-remove {
  width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted);
  font-size: 18px; cursor: pointer;
}
.cart-remove:hover { color: var(--accent); background: var(--surface); }

.cart-empty p { margin: 0; color: var(--muted); }
.cart-empty p:first-child { color: var(--text); font-weight: 600; margin-bottom: 4px; }

.cart-note { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; color: var(--text); background: var(--surface); border-left: 3px solid var(--accent); }
.cart-note:empty { display: none; }
.cart-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.cart-suggest:empty { display: none; }
.cart-chip {
  border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--surface-line));
  background: transparent; color: var(--text);
  border-radius: 999px; padding: 8px 14px;
  font: 500 13px/1 var(--body); cursor: pointer;
}
.cart-chip:hover { background: var(--surface); border-style: solid; }

.cart-code { display: flex; flex-direction: column; gap: 8px; }
.cart-code label { font-size: 13px; font-weight: 500; color: var(--muted); }
.cart-code-row { display: flex; gap: 8px; }
.cart-code input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border-radius: 8px; border: 1px solid var(--surface-line);
  background: var(--surface); color: var(--text);
  font: 500 16px/1 var(--body); letter-spacing: .04em; text-transform: uppercase;
}
.cart-code input::placeholder { text-transform: none; letter-spacing: 0; color: var(--muted); }
.cart-code input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cart-code .btn { flex: none; min-height: 44px; }
.cart-code-msg { margin: 0; font-size: 13px; min-height: 1.2em; }
.cart-code-msg.is-error { color: var(--accent); }
.cart-code-msg.is-ok { color: #3ccf7a; }
.cart-code input.shake { animation: shake .35s ease; border-color: var(--accent); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.cart-totals { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cart-totals div { display: flex; justify-content: space-between; gap: 12px; }
.cart-totals dt { color: var(--muted); }
.cart-totals dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; text-align: right; }
.cart-totals s { color: var(--muted); font-family: var(--body); font-weight: 400; font-size: 14px; margin-right: 4px; }
.cart-totals .cart-saving dt, .cart-totals .cart-saving dd { color: var(--accent); font-size: 14px; font-family: var(--body); font-weight: 600; }

.cart-consent { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cart-consent label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13px; line-height: 1.45; color: var(--muted); cursor: pointer; }
.cart-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.cart-consent a { color: var(--text); text-underline-offset: 2px; }
.cart-consent em { font-style: normal; opacity: .75; }
.cart-consent.shake { animation: shake .35s ease; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; animation: none; box-shadow: none; cursor: not-allowed; }
.btn[aria-disabled="true"]::after, .btn:disabled::after { display: none; }
.btn[aria-disabled="true"]:hover, .btn:disabled:hover { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Checkout: customer details */
.cart-details { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cart-details legend { padding: 0; margin-bottom: 6px; font-family: var(--display); font-weight: 700; font-size: 18px; }
.cart-details label { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 6px; }
.cart-details .req { color: var(--accent); }
.cart-details .opt { font-weight: 400; opacity: .8; }
.cart-details input, .cart-details textarea {
  width: 100%; min-width: 0; padding: 12px 14px;
  border-radius: 8px; border: 1px solid var(--surface-line);
  background: var(--surface); color: var(--text);
  font: 400 16px/1.4 var(--body);
}
.cart-details textarea { resize: vertical; min-height: 84px; }
.cart-details input::placeholder, .cart-details textarea::placeholder { color: var(--muted); opacity: .8; }
.cart-details input:focus, .cart-details textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cart-details input[aria-invalid="true"] { border-color: var(--accent); }
.cart-details input.shake { animation: shake .35s ease; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cart-form-msg { margin: 0; font-size: 13px; color: var(--accent); }
.cart-form-msg:empty { display: none; }
.cart-form-msg a { color: inherit; }
.cart-actions button[data-submit] { border: 0; }

/* Checkout: confirmation screen */
.cart-drawer.is-done > :not(.cart-head):not(.cart-done) { display: none !important; }
.cart-done { display: flex; flex-direction: column; gap: 16px; }
.cart-done h3 { font-family: var(--display); font-size: 28px; margin: 0; outline: none; }
.cart-done p { margin: 0; color: var(--muted); }
.cart-done strong { color: var(--text); overflow-wrap: anywhere; }
.done-note { font-size: 13px; padding: 8px 12px; border-radius: 8px; border: 1px dashed var(--surface-line); }
.done-icon svg { width: 64px; height: 64px; }
.done-icon circle { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: var(--accent); stroke-width: 2.5; }
.done-icon path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .cart-drawer.is-done .done-icon svg { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
  .cart-drawer.is-done .done-icon path { animation: draw .5s .2s ease-out both; }
  @keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  @keyframes draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
}
.done-box, .done-next { border: 1px solid var(--surface-line); border-radius: 12px; padding: 16px; background: var(--surface); }
.done-label { font-size: 12px !important; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px !important; }
.done-box ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.done-box li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
.done-box li.tot { padding-top: 8px; border-top: 1px solid var(--surface-line); font-weight: 600; }
.done-box li.tot + li.tot { border-top: 0; padding-top: 0; }
.done-next ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 15px; }
.cart-done .btn { width: 100%; border: 0; cursor: pointer; }

.cart-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.cart-actions .btn { width: 100%; cursor: pointer; font-family: var(--body); }
.cart-fine { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }

/* Card states */
button.btn { cursor: pointer; font-family: var(--body); border: 0; }
button.btn-ghost { border: 1px solid var(--accent); }
.btn.is-added, .btn.is-added:hover { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); animation: none; box-shadow: none; }
.btn.is-added::after { display: none; }
.offer.in-cart:not(.featured) { border-color: var(--accent); }
.btn.is-locked { opacity: .55; cursor: not-allowed; border-style: dashed; }
.btn.is-locked:hover { transform: none; }
.btn.is-locked::before { content: ""; width: 14px; height: 14px; margin-right: 8px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zm2 0h6V7a3 3 0 0 0-6 0z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1zm2 0h6V7a3 3 0 0 0-6 0z'/%3E%3C/svg%3E") center / contain no-repeat; }
.btn.shake { animation: shake .35s ease; }

.bundle-hint {
  margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  color: var(--muted);
}
.bundle-hint strong { color: var(--text); }
.bundle-tag {
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}

@media (max-width: 560px) {
  .cart-label { display: none; }
  .cart-toggle { padding: 0 10px; }
}

/* ---------- Touch screens (phones, iPads) ---------- */
@media (pointer: coarse) {
  /* finger-sized tap targets: at least 44px tall */
  .nav-link, .foot-nav a, .foot-legal a, .foot-contact a { display: inline-flex; align-items: center; min-height: 44px; }
  .foot-nav, .foot-legal nav { column-gap: 20px; row-gap: 0; }
  .lang-switch, .cart-toggle, .theme-toggle, .menu-toggle { height: 44px; }
  .theme-toggle { min-width: 44px; }
  .menu-toggle { width: 44px; }
  .cart-close { width: 44px; height: 44px; }
  .cart-remove { width: 44px; height: 44px; }
  .cart-chip { min-height: 44px; }
  .text-link { padding-block: 12px; }
  .btn { min-height: 48px; }
  .cart-consent label { padding-block: 4px; }
  .cart-consent input { width: 22px; height: 22px; }
  .cart-consent label { grid-template-columns: 22px minmax(0, 1fr); }
}
/* Very small phones (iPhone SE, 320–374px): tighter header so every button fits */
@media (max-width: 374px) {
  .site-header .wrap { gap: 8px; }
  .logo img { width: 34px; }
  .nav { gap: 6px; }
  .lang-switch span { padding: 0 7px; }
  .cart-toggle { padding: 0 8px; gap: 6px; }
  .theme-toggle { min-width: 40px; width: 40px; }
  .menu-toggle { width: 40px; padding: 0 9px; }
}

/* No "stuck" hover effects after tapping on touch screens */
@media (hover: none) {
  .btn:hover, .offer:hover, .shot:hover { transform: none; }
  .shot:hover { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55); border-color: var(--surface-line); }
}

/* ---------- Reduced motion: keep things calm ---------- */
@media (prefers-reduced-motion: reduce) {
  .featured { animation-duration: 14s; }
  .btn-primary { animation: none; box-shadow: 0 6px 22px -6px color-mix(in srgb, var(--accent) 55%, transparent); }
  .btn-primary::after { animation: none; display: none; }
  .offer:hover { transform: none; }
  .cart-toggle.bump, .cart-code input.shake, .cart-consent.shake { animation: none; }
  .cart-drawer, .cart-scrim { transition: none; }
}
