/* ==========================================================================
   FrameX — Base
   Reset, typography, layout primitives, reveal-on-scroll, accessibility.
   ========================================================================== */

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Safety net: no page-level sideways scroll, ever. Sections that need
     horizontal scrolling (chips, mobile carousels) scroll inside their own box. */
  overflow-x: clip;
}

/* Reveal animations start slightly off-position; clip them so they can never
   widen the page (important on phones, where sideways panning is disruptive). */
main {
  overflow-x: clip;
}

body.is-locked {
  overflow: hidden;
}

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

img,
video {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
}

/* Icons (inline SVG sprite) -------------------------------------------- */
.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--fill {
  fill: currentColor;
  stroke: none;
}

/* Focus ------------------------------------------------------------------ */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: calc(var(--z-toast) + 1);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus {
  transform: none;
}

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

/* Layout primitives ------------------------------------------------------- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-gap);
}

.section--tight-top {
  padding-top: 0;
}

/* Surfaces: sections alternate white and the soft light grey (--warm and --dark are the same soft surface) */
.section--warm {
  background: var(--surface-soft);
}

.section--dark {
  background: var(--surface-soft);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: var(--section-head-gap);
}

/* Heading levels -----------------------------------------------------------
   The size and weight of every heading on the site is set here, once.
   Component files only add what is their own (colour, max-width, margins). */

/* H2: the heading of a section */
.section-title,
.hanging__title,
.chapter__title,
.custom-frame__title,
.final-cta__title,
.museum__title,
.showcase__title {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: var(--weight-h2);
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-heading);
  text-wrap: balance;
}

/* Title of a task screen: a product, a template, checkout, orders, the account */
.pp-title,
.pdp-info__title,
.tpl-info__title,
.tpl-custom__title,
.was__title,
.co-title,
.account__title,
.shop-hero__name,
.sd-title,
.fs-brand {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-title);
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-heading);
}

/* The same title inside a narrow card: log in, sign up, new password */
.auth-card__title {
  font-family: var(--font-display);
  font-size: var(--text-title-sm);
  font-weight: var(--weight-title);
  line-height: 1.2;
}

/* H2 on a task screen (product, design, shop): a size down from that screen's title */
.pp-section__title,
.section-title--sm {
  font-family: var(--font-display);
  font-size: var(--text-h2-sm);
  font-weight: var(--weight-title);
}

/* The price on a product or design screen */
.pp-price strong,
.tpl-info__price strong {
  font-family: var(--font-display);
  font-size: var(--text-price-lg);
  font-weight: var(--weight-strong);
}

/* H3: a block inside a section */
.contact-strip h3,
.prose h2,
.gallery-promo h2,
.order-options__subtitle,
.tpl-saved__title,
.tpl-how__title,
.faq-group__title,
.fs-title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-h3);
  line-height: 1.25;
}

/* H4: the heading of a panel or a feature card */
.service-card h3,
.method-card h3,
.how-step__body h3,
.journey__step h3,
.account-card h2,
.co-card__title,
.legal-section h2,
.shop-card__name,
.drawer__title {
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: var(--weight-h3);
  line-height: 1.3;
}

/* Small uppercase label above a heading */
.eyebrow {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-lead {
  max-width: 56ch;
  margin-top: 8px;
  color: var(--muted);
}

/* Gradient text used in the Original's headings */
.text-gradient-wine {
  background: linear-gradient(90deg, var(--ink), var(--wine));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-amber {
  background: linear-gradient(90deg, var(--gold), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Reveal on scroll ---------------------------------------------------------
   Only active when JS has flagged <html class="js">, so content is never
   hidden for visitors without scripting. */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js [data-reveal="left"] {
  transform: translate3d(-40px, 0, 0);
}

.js [data-reveal="right"] {
  transform: translate3d(40px, 0, 0);
}

.js [data-reveal="zoom"] {
  transform: scale(0.96);
}

.js [data-reveal="fade"] {
  transform: none;
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Skeleton loading state --------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--stone-soft);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

/* Respect reduced-motion preferences --------------------------------------- */
@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;
    transition-delay: 0ms !important;
  }

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