/* ==========================================================================
   base.css — reset, typography, form elements, utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--announce-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 8% -8%, rgba(201, 164, 92, 0.09), transparent 60%),
    radial-gradient(900px 480px at 100% 4%, rgba(47, 128, 121, 0.08), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--gold-300);
  color: var(--navy-900);
}

/* Slim, on-brand scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--cream-400) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--cream-400);
  border: 3px solid var(--bg);
  border-radius: var(--r-pill);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--gold-500);
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--heading);
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.15rem);
}
h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.5rem);
}
h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}
h4 {
  font-size: var(--fs-xl);
}
h5 {
  font-size: var(--fs-lg);
}

p {
  margin: 0 0 var(--sp-4);
}

a {
  color: var(--navy-600);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--brand-dark);
}

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

ul,
ol {
  margin: 0 0 var(--sp-4);
  padding-left: 1.15rem;
}

li {
  margin-bottom: var(--sp-2);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--sp-6) 0;
}

blockquote {
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border-left: 3px solid var(--brand);
  background: var(--cream-100);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-style: italic;
  color: var(--ink-700);
}

code,
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--cream-200);
  padding: 0.1em 0.4em;
  border-radius: var(--r-xs);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

th,
td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

th {
  font-weight: 600;
  color: var(--heading);
  background: var(--cream-100);
}

/* ------------------------------ focus -------------------------------- */

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.on-dark :focus-visible,
.footer :focus-visible {
  --focus: var(--gold-300);
}

/* Screen-reader only text */
.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;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  z-index: var(--z-toast);
  background: var(--navy-800);
  color: var(--white);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 0;
  color: var(--white);
}

/* ------------------------------ forms -------------------------------- */

label,
.field-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--heading);
  margin-bottom: var(--sp-2);
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
input[type='password'],
input[type='search'],
input[type='date'],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.7rem 0.9rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  /* 16px prevents iOS zoom on focus */
  font-size: max(16px, var(--fs-base));
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-300);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(201, 164, 92, 0.18);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--cream-100);
  color: var(--ink-400);
  cursor: not-allowed;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6c7d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.25rem;
}

input[type='checkbox'],
input[type='radio'] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex: 0 0 auto;
  cursor: pointer;
}

input[type='file'] {
  width: 100%;
  font-size: var(--fs-sm);
  padding: var(--sp-3);
  background: var(--cream-100);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}

.field {
  margin-bottom: var(--sp-4);
}

.field-hint {
  font-size: var(--fs-xs);
  color: var(--text-mute);
  margin-top: var(--sp-1);
}

.field-error {
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: var(--sp-1);
  min-height: 1em;
}

input.invalid,
textarea.invalid,
select.invalid {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.checkbox-row label {
  margin: 0;
  font-weight: 400;
  font-size: var(--fs-sm);
  color: var(--ink-700);
  line-height: 1.5;
}

/* ---------------------------- utilities ------------------------------ */

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

.container--narrow {
  max-width: var(--container-narrow);
}

.text-center {
  text-align: center;
}

.muted {
  color: var(--text-soft);
}

.mute-2 {
  color: var(--text-mute);
}

.small {
  font-size: var(--fs-sm);
}

.xsmall {
  font-size: var(--fs-xs);
}

/* Standalone text links keep the layout they had (padding is cancelled by an
   equal negative margin) but get a target of at least ~24px for touch,
   meeting WCAG 2.2 SC 2.5.8. Links inside running prose are untouched. */
.breadcrumb a,
.notfound__links a,
.side-links a,
.help-card__text a,
.auth-card__foot a,
.auth-card p.xsmall a,
.footer__col li a,
.footer__legal-links a,
.product-card__collection {
  display: inline-block;
  padding: 4px 0;
  margin: -4px 0;
}

.strong {
  font-weight: 600;
}

.nowrap {
  white-space: nowrap;
}

.stack > * + * {
  margin-top: var(--sp-4);
}

.flex {
  display: flex;
  gap: var(--sp-3);
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.mt-0 {
  margin-top: 0;
}
.my-1 {
  margin-block: var(--sp-1);
}
.my-2 {
  margin-block: var(--sp-2);
}
.my-3 {
  margin-block: var(--sp-3);
}
.my-4 {
  margin-block: var(--sp-4);
}
.my-5 {
  margin-block: var(--sp-5);
}
.my-6 {
  margin-block: var(--sp-6);
}
.mt-2 {
  margin-top: var(--sp-2);
}
.mt-3 {
  margin-top: var(--sp-3);
}
.mt-4 {
  margin-top: var(--sp-4);
}
.mt-5 {
  margin-top: var(--sp-5);
}
.mt-6 {
  margin-top: var(--sp-6);
}
.mb-0 {
  margin-bottom: 0;
}
.mb-2 {
  margin-bottom: var(--sp-2);
}
.mb-3 {
  margin-bottom: var(--sp-3);
}
.mb-4 {
  margin-bottom: var(--sp-4);
}
.mb-5 {
  margin-bottom: var(--sp-5);
}
.mb-6 {
  margin-bottom: var(--sp-6);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.hide {
  display: none !important;
}

/* Visible only to screen readers until focused */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* -------------------------- scroll reveal ---------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal-delay='1'] {
  transition-delay: 0.08s;
}
[data-reveal-delay='2'] {
  transition-delay: 0.16s;
}
[data-reveal-delay='3'] {
  transition-delay: 0.24s;
}
[data-reveal-delay='4'] {
  transition-delay: 0.32s;
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------ print -------------------------------- */

@media print {
  .announcement,
  .site-header,
  .site-footer,
  .fab,
  .back-to-top,
  .cart-drawer,
  .drawer-backdrop {
    display: none !important;
  }
  body {
    background: #fff;
  }
}
