/* ============================================================
   HOME BY METROPOLITAN — Design Tokens
   ============================================================ */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6.5vw, 7rem);

  /* Spacing (4px system) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1000px;
  --content-wide: 1280px;

  /* Fonts */
  --font-display: 'Cormorant', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Switzer', 'Inter', 'Helvetica Neue', sans-serif;
}

/* ============================================================
   Light mode — warm parchment & espresso, brass accent
   ============================================================ */
:root,
[data-theme='light'] {
  --color-bg: #f8f4ec;
  --color-surface: #fbf8f2;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f1ead9;
  --color-surface-offset-2: #eae0cb;
  --color-divider: #e2d8c3;
  --color-border: #d6c9ac;

  --color-text: #2b2420;
  --color-text-muted: #6e6252;
  --color-text-faint: #a89b84;
  --color-text-inverse: #fbf8f2;

  /* Primary = deep espresso ink (buttons, headings emphasis) */
  --color-primary: #2b2420;
  --color-primary-hover: #453a30;
  --color-primary-active: #1a1512;
  --color-primary-highlight: #e5dcc7;

  /* Accent = warm brass/gold (links, underlines, small highlights) */
  --color-accent: #a1793a;
  --color-accent-hover: #7e5e2c;
  --color-accent-active: #5f4720;
  --color-accent-highlight: #ece0c6;

  /* Terracotta = warmth for sale/urgency callouts */
  --color-terracotta: #b5602e;
  --color-terracotta-hover: #954c22;
  --color-terracotta-highlight: #f0d9c8;

  --color-success: #4c7a3c;
  --color-error: #a13a3a;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 60 / 0.08);
  --shadow-md: 0 6px 20px oklch(0.2 0.02 60 / 0.1);
  --shadow-lg: 0 16px 40px oklch(0.2 0.02 60 / 0.16);
}

/* ============================================================
   Dark mode — deep espresso, warm cream text, lifted brass
   ============================================================ */
[data-theme='dark'] {
  --color-bg: #1a1512;
  --color-surface: #201a16;
  --color-surface-2: #251f1a;
  --color-surface-offset: #2a231d;
  --color-surface-offset-2: #322922;
  --color-divider: #3a3129;
  --color-border: #453a30;

  --color-text: #f1e9da;
  --color-text-muted: #b9ab94;
  --color-text-faint: #7d7161;
  --color-text-inverse: #1a1512;

  --color-primary: #f1e9da;
  --color-primary-hover: #ffffff;
  --color-primary-active: #d8cdb9;
  --color-primary-highlight: #3a3129;

  --color-accent: #cba05a;
  --color-accent-hover: #ddb877;
  --color-accent-active: #b08946;
  --color-accent-highlight: #3a3126;

  --color-terracotta: #d17d4f;
  --color-terracotta-hover: #e39468;
  --color-terracotta-highlight: #3c2a20;

  --color-success: #7ea86a;
  --color-error: #d17070;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #1a1512;
    --color-surface: #201a16;
    --color-surface-2: #251f1a;
    --color-surface-offset: #2a231d;
    --color-surface-offset-2: #322922;
    --color-divider: #3a3129;
    --color-border: #453a30;
    --color-text: #f1e9da;
    --color-text-muted: #b9ab94;
    --color-text-faint: #7d7161;
    --color-text-inverse: #1a1512;
    --color-primary: #f1e9da;
    --color-primary-hover: #ffffff;
    --color-primary-active: #d8cdb9;
    --color-primary-highlight: #3a3129;
    --color-accent: #cba05a;
    --color-accent-hover: #ddb877;
    --color-accent-active: #b08946;
    --color-accent-highlight: #3a3126;
    --color-terracotta: #d17d4f;
    --color-terracotta-hover: #e39468;
    --color-terracotta-highlight: #3c2a20;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 6px 20px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
  }
}

/* ============================================================
   Base typography
   ============================================================ */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

p {
  max-width: 62ch;
}

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

/* ============================================================
   Layout primitives
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-12));
}

.section {
  padding-block: clamp(var(--space-16), 10vw, var(--space-32));
}

.section--tight {
  padding-block: clamp(var(--space-12), 7vw, var(--space-20));
}

/* ============================================================
   Header
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition:
    transform 0.35s var(--ease-out),
    border-color var(--transition-interactive);
}
.header--scrolled {
  border-color: var(--color-divider);
}
.header--hidden {
  transform: translateY(-100%);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-5);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.brand__mark {
  width: 34px;
  height: 34px;
  color: var(--color-primary);
  flex-shrink: 0;
}
.brand__word {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand__word span:first-child {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
}
.brand__word span:last-child {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav__links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  position: relative;
  padding-block: var(--space-1);
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--color-accent);
  transition: right var(--transition-interactive);
}
.nav__links a:hover {
  color: var(--color-text);
}
.nav__links a:hover::after {
  right: 0;
}

@media (max-width: 720px) {
  .nav__links { display: none; }
}

@media (max-width: 480px) {
  .brand__word span:last-child { display: none; }
  .header__inner { gap: var(--space-3); }
  .nav { gap: var(--space-3); }
}

/* Theme toggle */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.theme-toggle:hover {
  background: var(--color-surface-offset);
  border-color: var(--color-accent);
}
.theme-toggle svg { width: 17px; height: 17px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn--primary:active {
  transform: translateY(0);
  background: var(--color-primary-active);
}
.btn--ghost {
  border-color: var(--color-border);
  color: var(--color-text);
  background: transparent;
}
.btn--ghost:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.btn--sm {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-xs);
}
.btn--block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    oklch(from var(--color-bg) l c h / 0.97) 0%,
    oklch(from var(--color-bg) l c h / 0.9) 34%,
    oklch(from var(--color-bg) l c h / 0.42) 62%,
    oklch(from var(--color-bg) l c h / 0.12) 100%
  );
}
.hero__content {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding-block: var(--space-20);
}
.hero__content .eyebrow {
  margin-bottom: var(--space-5);
  display: block;
}
.hero h1 {
  font-size: var(--text-hero);
  margin-bottom: var(--space-6);
}
.hero__sub {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 46ch;
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.hero__actions .link-arrow {
  font-size: var(--text-sm);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
}
.hero__actions .link-arrow:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.hero__actions .link-arrow svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-interactive);
}
.hero__actions .link-arrow:hover svg {
  transform: translateX(3px);
}

@media (max-width: 640px) {
  .hero { min-height: 100vh; }
  .hero__content { max-width: 100%; padding-block: var(--space-24) var(--space-16); }
  .hero__scrim {
    background: linear-gradient(
      180deg,
      oklch(from var(--color-bg) l c h / 0.55) 0%,
      oklch(from var(--color-bg) l c h / 0.94) 46%,
      var(--color-bg) 72%
    );
  }
}

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal {
  opacity: 1;
}
@supports (animation-timeline: scroll()) {
  .reveal {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 55%;
  }
}
@keyframes reveal-fade {
  to { opacity: 1; }
}

/* ============================================================
   About / split section
   ============================================================ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(var(--space-10), 6vw, var(--space-20));
  align-items: center;
}
.split--reverse .split__media { order: 2; }
.split--reverse .split__text { order: 1; }
.split__media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
}
.split__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.split__text h2 {
  font-size: var(--text-2xl);
  margin-block: var(--space-4) var(--space-5);
}
.split__text p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-bottom: var(--space-4);
}
.split__text p:last-of-type { margin-bottom: 0; }

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media,
  .split--reverse .split__text { order: initial; }
}

/* ============================================================
   Pillars grid
   ============================================================ */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.pillar {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition:
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}
.pillar:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.pillar__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  background: var(--color-accent-highlight);
  color: var(--color-accent);
  margin-bottom: var(--space-5);
}
.pillar__icon svg { width: 20px; height: 20px; }
.pillar h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-family: var(--font-body);
}
.pillar p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.pillar__tag {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-terracotta);
  font-weight: 600;
}

@media (max-width: 820px) {
  .pillars { grid-template-columns: 1fr; }
}

/* ============================================================
   Warehouse sale banner
   ============================================================ */
.banner {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
}
.banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(0.15 0.02 60 / 0.05) 0%, oklch(0.1 0.02 60 / 0.86) 100%);
}
.banner__content {
  position: relative;
  z-index: 1;
  padding: clamp(var(--space-8), 5vw, var(--space-12));
  color: #f8f4ec;
  max-width: 640px;
}
.banner__content .eyebrow { color: #e3c78a; }
.banner__content h2 {
  font-size: var(--text-2xl);
  margin-block: var(--space-3) var(--space-4);
  color: #f8f4ec;
}
.banner__content p {
  color: #e6ddc9;
  margin-bottom: var(--space-6);
}
.banner .btn--primary {
  background: #f8f4ec;
  color: #2b2420;
}
.banner .btn--primary:hover { background: #ffffff; }

/* ============================================================
   Signup section
   ============================================================ */
.signup {
  background: var(--color-surface-offset);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-divider);
  padding: clamp(var(--space-10), 6vw, var(--space-16));
  text-align: center;
  position: relative;
  overflow: hidden;
}
.signup__inner {
  max-width: 520px;
  margin-inline: auto;
  position: relative;
  z-index: 1;
}
.signup h2 {
  font-size: var(--text-2xl);
  margin-block: var(--space-3) var(--space-3);
}
.signup p {
  color: var(--color-text-muted);
  margin-inline: auto;
  margin-bottom: var(--space-8);
}
.form-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.field {
  flex: 1 1 180px;
  text-align: left;
}
.field label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.field input {
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: var(--text-base);
}
.field input:focus-visible {
  border-color: var(--color-accent);
}
.field input::placeholder { color: var(--color-text-faint); }
.field--wide { flex-basis: 100%; }

.signup-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.signup-form .btn {
  margin-top: var(--space-1);
}
.signup__fineprint {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-5);
  margin-bottom: 0;
}
.signup__status {
  font-size: var(--text-sm);
  margin-top: var(--space-3);
  min-height: 1.4em;
}
.signup__status[data-state='error'] { color: var(--color-error); }
.signup__status[data-state='success'] { color: var(--color-success); font-weight: 600; }

.signup__success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-6);
}
.signup__success svg {
  width: 40px;
  height: 40px;
  color: var(--color-success);
}
.signup__success[data-visible='true'] { display: flex; }
.signup-form[data-hidden='true'] { display: none; }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-8);
  flex-wrap: wrap;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.footer__brand svg { width: 26px; height: 26px; color: var(--color-text-muted); }
.footer__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 380px;
}
.footer__text a {
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.footer__text a:hover { color: var(--color-accent); border-color: var(--color-accent); }
.footer__meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .footer__inner { flex-direction: column; }
}
