/* Theme Name: POPHIES
   Description: Design system for POPHIES — indoor decorative lighting manufacturer.
   Global styles only. Page-specific layout lives in assets/css/page-*.css. */

/* ---------- 1. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--ivory);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

body.admin-bar .site-header { top: 32px; }

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

a { color: inherit; }

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

::selection { color: var(--ink); background: var(--light); }

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 14px 20px;
  background: var(--ink);
  color: var(--white);
  font-size: var(--fs-small);
  text-decoration: none;
}

.skip-link:focus { left: 16px; top: 16px; }

/* ---------- 2. Typography ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 560;
  letter-spacing: var(--track-tight);
  color: var(--ink);
}

h1 { font-size: var(--fs-display); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); line-height: 1.06; }
h3 { font-size: var(--fs-h3); line-height: 1.18; font-weight: 590; }
h4 {
  font-size: var(--fs-h4);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p { margin: 0; color: var(--graphite); }

.lede {
  max-width: 620px;
  font-size: clamp(1.06rem, 1.4vw, 1.24rem);
  line-height: 1.6;
}

.read { max-width: var(--read); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--brass);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

.eyebrow::before {
  width: 28px;
  height: 1px;
  content: "";
  background: currentColor;
}

.eyebrow--plain::before { display: none; }

.accent { color: var(--brass); }

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

.section { padding: var(--section) 0; }
.section--tight { padding: var(--section-sm) 0; }
.section--white { background: var(--white); }
.section--stone { background: var(--surface-soft); }
.section--soft { background: var(--surface-soft); }

.section--dark {
  color: var(--white);
  background: var(--ink);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--white); }

.section--dark p { color: var(--on-dark-muted); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.58fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: end;
  margin-bottom: 64px;
}

.section-head__lead p { font-size: 1.0625rem; }
.section-head--stack { grid-template-columns: minmax(0, 1fr); }

/* ---------- 4. Site header ---------- */
.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  border-bottom: 1px solid rgba(216, 211, 202, 0.7);
  background: rgba(245, 241, 233, 0.86);
  backdrop-filter: blur(18px);
}

.site-header[data-scrolled="true"] { background: rgba(245, 241, 233, 0.96); }

.nav {
  display: flex;
  min-height: var(--header-h);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.brand-mark::before {
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 16px var(--light);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--graphite);
  font-size: var(--fs-small);
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--brass); }

.nav-links .button {
  color: var(--white);
  font-size: 0.875rem;
  letter-spacing: 0;
}

.nav-links .button:hover { color: var(--white); }

.nav-links__text { display: flex; align-items: center; gap: 28px; }

/* ---------- 5. Buttons and links ---------- */
.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.button:hover {
  border-color: var(--brass);
  background: var(--brass);
  transform: translateY(-2px);
}

.button.secondary {
  color: var(--ink);
  background: transparent;
}

.button.secondary:hover {
  border-color: var(--ink);
  background: var(--white);
  color: var(--ink);
}

.button--compact { min-height: 42px; padding: 0 16px; font-size: 0.8125rem; }

.arrow { display: inline-block; transition: transform 0.25s var(--ease); }
.button:hover .arrow { transform: translateX(4px); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--stone);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.text-link:hover { border-color: var(--brass); color: var(--brass); }
.text-link:hover .arrow { transform: translateX(4px); }

/* ---------- 6. Media placeholder ---------- */
.media { margin: 0; }

.media__frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(32, 33, 31, 0.045) 0 1px,
      transparent 1px 52px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(32, 33, 31, 0.045) 0 1px,
      transparent 1px 52px
    ),
    linear-gradient(135deg, #dedbd4 0%, #e9e5dd 52%, #d5d1c8 100%);
}

.media__frame img { width: 100%; height: 100%; object-fit: cover; }

.media__ratio-4x3 .media__frame { aspect-ratio: 4 / 3; }
.media__ratio-3x2 .media__frame { aspect-ratio: 3 / 2; }
.media__ratio-1x1 .media__frame { aspect-ratio: 1 / 1; }
.media__ratio-3x4 .media__frame { aspect-ratio: 3 / 4; }
.media__ratio-16x9 .media__frame { aspect-ratio: 16 / 9; }
.media__ratio-tall .media__frame { aspect-ratio: 4 / 5; }

.media__label {
  max-width: 78%;
  color: #6d6e69;
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--track-label);
  text-align: center;
  text-transform: uppercase;
}

.media__badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(32, 33, 31, 0.16);
  border-radius: var(--radius-sm);
  color: var(--graphite);
  background: rgba(252, 251, 248, 0.78);
  font-size: 0.625rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.media__caption {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  color: var(--graphite);
  font-size: var(--fs-small);
}

.media__caption span:first-child {
  color: var(--brass);
  font-weight: 700;
}

/* ---------- 7. Shared blocks ---------- */
.facts {
  display: grid;
  grid-template-columns: repeat(var(--fact-cols, 3), minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--stone);
  border-bottom: 1px solid var(--stone);
  list-style: none;
}

.facts li { padding: 20px 16px 20px 0; }
.facts li + li {
  padding-left: 20px;
  border-left: 1px solid var(--stone);
}

.facts strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.facts span { color: var(--graphite); font-size: var(--fs-label); }

.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--hairline {
  gap: 1px;
  border: 1px solid var(--stone);
  background: var(--stone);
}

.grid--hairline > * { background: var(--ivory); }
.grid--hairline.grid--white > * { background: var(--white); }

.section--dark .grid--hairline {
  border-color: var(--on-dark-line);
  background: var(--on-dark-line);
}

.section--dark .grid--hairline > * { background: var(--ink); }

.card {
  padding: 30px;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.card--flush { border: 0; border-radius: 0; }

.card__index {
  display: block;
  margin-bottom: 22px;
  color: var(--brass);
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card h3 + p,
.card h4 + p { margin-top: 12px; }
.card p { font-size: 0.98rem; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }

.tag {
  padding: 5px 9px;
  border: 1px solid var(--stone);
  border-radius: var(--radius-sm);
  color: var(--graphite);
  font-size: 0.625rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section--dark .tag { border-color: var(--on-dark-line); color: var(--on-dark-muted); }

.rule-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--stone);
}

.rule-list li {
  display: flex;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--stone);
  color: var(--graphite);
  font-size: 0.98rem;
}

.rule-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin-top: 0.62em;
  border-radius: 50%;
  background: var(--brass);
}

.rule-list strong { color: var(--ink); font-weight: 650; }

.section--dark .rule-list,
.section--dark .rule-list li { border-color: var(--on-dark-line); }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--stone);
}

.steps li::before {
  counter-increment: step;
  content: "0" counter(step);
  color: var(--brass);
  font-size: var(--fs-label);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.steps h4 { margin-bottom: 6px; }
.steps p { font-size: 0.98rem; }

/* ---------- 8. Footer ---------- */
.site-footer {
  padding: 84px 0 40px;
  color: var(--white);
  background: var(--ink);
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--light); }

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
}

.footer-title {
  max-width: 760px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  font-weight: 560;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.footer-meta {
  color: var(--on-dark-dim);
  font-size: var(--fs-small);
  line-height: 1.9;
  text-align: right;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 56px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--on-dark-line);
  color: var(--on-dark-dim);
  font-size: var(--fs-small);
  list-style: none;
}

.footer-links li:last-child { margin-left: auto; }

/* ---------- 9. Motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

@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;
  }

  html.js .reveal { opacity: 1; transform: none; }
}

/* ---------- 10. Utilities and responsive ---------- */
.stack > * + * { margin-top: 18px; }
.stack-lg > * + * { margin-top: 32px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mt-64 { margin-top: 64px; }
.center { text-align: center; }
.full { grid-column: 1 / -1; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .section-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    margin-bottom: 44px;
  }

  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .footer-meta { text-align: left; }
  .footer-links li:last-child { margin-left: 0; }
}

@media (max-width: 660px) {
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }

  .facts { grid-template-columns: minmax(0, 1fr); }

  .facts li { padding: 18px 0; }
  .facts li + li {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--stone);
  }

  .card { padding: 24px; }
  .site-footer { padding: 64px 0 32px; }

  .nav { min-height: var(--header-h); gap: 12px; }
  .nav-links { gap: 16px; }
  .nav-links__text { gap: 16px; }
  .nav-links .button { min-height: 40px; padding: 0 13px; font-size: 0.75rem; }
  .brand-word { font-size: 13px; letter-spacing: 0.18em; }
}

/* ---------- 11. Context variants ---------- */
.facts--4 { --fact-cols: 4; }

.section--dark .media__frame {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(252, 251, 248, 0.06) 0 1px,
      transparent 1px 52px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(252, 251, 248, 0.06) 0 1px,
      transparent 1px 52px
    ),
    linear-gradient(135deg, #33342f 0%, #414240 55%, #2c2d29 100%);
}

.section--dark .media__label { color: #9a9b96; }

.section--dark .media__badge {
  border-color: rgba(252, 251, 248, 0.18);
  color: var(--on-dark-muted);
  background: rgba(32, 33, 31, 0.7);
}

.section--dark .media__caption { color: var(--on-dark-muted); }

.section--dark .rule-list li { color: var(--on-dark-muted); }
.section--dark .rule-list strong { color: var(--white); }
.section--dark .steps li { border-color: var(--on-dark-line); }

.section--dark .facts,
.section--dark .facts li + li { border-color: var(--on-dark-line); }
.section--dark .facts strong { color: var(--white); }
.section--dark .facts span { color: var(--on-dark-muted); }

/* Small brass labels need the warm-light tone on dark surfaces for AA contrast. */
.section--dark .eyebrow { color: var(--light); }
.section--dark .card__index { color: var(--light); }
.section--dark .media__caption span:first-child { color: var(--light); }
