/* Vermalle — base styles: tokens, reset, typography */

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #111111;
  --ink-muted: #6b6b6b;
  --border: #e7e5e0;
  --accent: #111111;
  --accent-contrast: #ffffff;
  --danger: #b3261e;
  --success: #1f6b3a;

  --radius-sm: 4px;
  --radius-md: 8px;

  --container: 1280px;
  --gutter: 1rem;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --page-fade: 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Brief fade-in of the main column on initial paint — avoids the harsh
 * flash-cut between routes. Respects prefers-reduced-motion. Opacity-only:
 * a transform on <main> would establish a containing block and break
 * `position: fixed` for descendants like the mobile filter drawer. */
@keyframes vermalle-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Cross-document View Transitions. Same-origin navigations in Chrome 126+
 * get a smooth fade between pages without any JS hook. Older browsers
 * ignore this at-rule and fall back to the main#main opacity fade above. */
@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: no-preference) {
  main#main {
    animation: vermalle-page-in var(--page-fade) both;
  }
}

:root {
  --noop: 1;
}

@media (min-width: 768px) {
  :root {
    --gutter: 2rem;
  }
}

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

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  font-weight: 500;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  font-weight: 500;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.05rem;
}

p {
  margin: 0 0 1em;
  color: var(--ink);
}

a {
  color: var(--ink);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.7;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.btn:hover {
  opacity: 0.85;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--accent-contrast);
  opacity: 1;
}

input,
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  width: 100%;
}

/* iOS Safari auto-zooms on focus when text input font-size < 16 px —
 * jarring on a checkout form. Pin to 16 px on touch viewports. */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px;
  }
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.muted {
  color: var(--ink-muted);
}

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