/* ================================================================
   TERRA — WARM MAGAZINE / ASYMMETRIC LAYOUT
   Sand & terracotta. Newsreader italic display, DM Sans body.
   ================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Amiri:ital,wght@0,400;1,400;0,700&family=Tajawal:wght@300;400;500;700&display=swap");

:root {
  --bg: #f4ede4;
  --paper: #fbf7f1;
  --ink: #3a2f24;
  --ink-2: #5a4836;
  --muted: #8b7a64;
  --line: rgba(58,47,36,0.18);
  --line-2: rgba(58,47,36,0.34);
  --terra: #c2693a;
  --terra-2: #8c4a23;
  --olive: #7a8050;
  --bone: #e8dcc8;
  --accent: var(--terra);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --f-disp: "Newsreader", serif;
  --f-body: "DM Sans", sans-serif;
  --f-mono: "JetBrains Mono", monospace;
}
html[dir="rtl"] {
  --f-disp: "Amiri", serif;
  --f-body: "Tajawal", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body {
  font-family: var(--f-body);
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
input, textarea, select { font-family: inherit; color: inherit; }
::selection { background: var(--terra); color: var(--paper); }

/* texture overlay */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: 0.07; mix-blend-mode: multiply;
}

/* type */
.serif { font-family: var(--f-disp); }
.serif-i { font-family: var(--f-disp); font-style: italic; font-weight: 300; }
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.eyebrow { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }

/* ---------- nav (soft pill at top) ---------- */
.nav {
  position: sticky; top: 16px; z-index: 50;
  margin: 16px auto 0; max-width: 1320px; padding: 0 24px;
  display: flex; justify-content: center;
}
.nav-pill {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 24px; align-items: center;
  padding: 12px 24px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 100px;
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(58,47,36,0.06);
  width: 100%;
}
.brand-terra { font-family: var(--f-disp); font-style: italic; font-weight: 400; font-size: 26px; letter-spacing: -0.02em; line-height: 1; }
.nav-links { display: flex; gap: 8px; justify-content: center; }
.nav-link {
  padding: 8px 16px; border-radius: 100px;
  font-family: var(--f-body); font-size: 14px; font-weight: 500;
  transition: background-color .25s, color .25s;
}
.nav-link:hover { background: var(--bg); color: var(--terra); }
.nav-link.is-active { background: var(--ink); color: var(--paper); }
.nav-actions { display: flex; gap: 6px; align-items: center; }
.nav-actions button, .nav-actions a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background-color .2s;
  position: relative; color: var(--ink);
}
.nav-actions a:hover, .nav-actions button:hover { background: var(--bg); }
.nav-actions [data-cart-count]::after {
  content: attr(data-count); position: absolute; top: 0; inset-inline-end: 0;
  background: var(--terra); color: var(--paper);
  min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 9px;
}
[data-cart-count].is-zero::after { display: none; }

@media (max-width: 900px) {
  .nav-pill { grid-template-columns: auto 1fr auto; }
  .nav-links { display: none; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; }

.drawer { position: fixed; inset: 0; z-index: 80; background: var(--bg); transform: translateY(-100%); transition: transform .5s var(--ease); }
.drawer.open { transform: none; }
.drawer .inner { padding: 80px 24px; }
.drawer a { font-family: var(--f-disp); font-style: italic; font-size: 40px; line-height: 1.5; display: block; }
.drawer .x { position: absolute; top: 20px; inset-inline-end: 20px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; }

/* container */
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }
.wrap-tight { max-width: 920px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 2; }
.section { padding: 96px 0; }
@media (max-width: 768px) { .section { padding: 64px 0; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 24px;
  font-family: var(--f-body); font-size: 14px; font-weight: 500;
  border: 1px solid var(--ink); color: var(--ink); background: transparent;
  border-radius: 100px;
  transition: all .35s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn.terra { background: var(--terra); color: var(--paper); border-color: var(--terra); }
.btn.terra:hover { background: var(--terra-2); border-color: var(--terra-2); transform: translateY(-1px); }
.btn.ghost { background: var(--paper); }
.arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
html[dir="rtl"] .btn:hover .arrow { transform: translateX(-3px); }

.ul-link { position: relative; display: inline-block; padding-bottom: 2px; border-bottom: 1px solid var(--ink); transition: border-color .25s, color .25s; }
.ul-link:hover { color: var(--terra); border-color: var(--terra); }

/* product card */
.card { display: block; position: relative; }
.card .frame { aspect-ratio: 3/4; overflow: hidden; background: var(--paper); border-radius: 4px; position: relative; }
.card .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.card:hover .frame img { transform: scale(1.05); }
.card .badge {
  position: absolute; top: 14px; inset-inline-start: 14px;
  background: var(--paper); border: 1px solid var(--ink);
  padding: 4px 10px; border-radius: 100px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
}
.card .badge.pre { background: var(--terra); color: var(--paper); border-color: var(--terra); }
.card .name { font-family: var(--f-disp); font-style: italic; font-size: 22px; line-height: 1.2; margin-top: 14px; }
.card .meta { font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 4px; }
.card .price { font-family: var(--f-body); font-size: 15px; font-weight: 500; margin-top: 4px; }

/* asymmetric grid */
.amg { display: grid; gap: 32px 24px; grid-template-columns: repeat(12, 1fr); }
@media (max-width: 1024px) { .amg { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 600px) { .amg { grid-template-columns: 1fr 1fr; gap: 24px 16px; } }
.amg .item { grid-column: span 3; }
.amg .item.big { grid-column: span 4; }
.amg .item.wide { grid-column: span 5; }
.amg .item.offset { margin-top: 80px; }
.amg .item.offset-2 { margin-top: 40px; }
@media (max-width: 1024px) { .amg .item, .amg .item.big, .amg .item.wide { grid-column: span 3; } .amg .item.offset, .amg .item.offset-2 { margin-top: 0; } }
@media (max-width: 600px) { .amg .item, .amg .item.big, .amg .item.wide { grid-column: span 1; } }

/* uniform grid */
.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
@media (min-width: 768px) { .pgrid { grid-template-columns: repeat(3, 1fr); gap: 48px 32px; } }
@media (min-width: 1100px) { .pgrid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

/* hero */
.hero {
  position: relative; padding: 64px 24px 96px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 56px; align-items: center; max-width: 1400px; margin: 0 auto;
}
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding: 48px 24px 64px; } }
.hero-img { aspect-ratio: 4/5; overflow: hidden; border-radius: 4px; position: relative; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.hero-img:hover img { transform: scale(1.04); }
.hero-img .caption {
  position: absolute; bottom: 16px; inset-inline-start: 16px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--paper); background: rgba(58,47,36,0.5); padding: 6px 12px; border-radius: 100px;
  backdrop-filter: blur(4px);
}
.hero h1 {
  font-family: var(--f-disp); font-style: italic; font-weight: 300;
  font-size: clamp(48px, 7vw, 104px); letter-spacing: -0.02em; line-height: 1; margin: 18px 0 24px;
}
.hero h1 .terra { color: var(--terra); }

/* form */
.field {
  display: block; width: 100%;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 14px 0; font-family: var(--f-body); font-size: 16px; color: var(--ink);
  outline: none; transition: border-color .3s;
}
.field:focus { border-bottom-color: var(--terra); }
.field-label { display: block; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field-box {
  width: 100%; background: var(--paper); border: 1px solid var(--line);
  padding: 14px 18px; font-family: var(--f-body); font-size: 15px; color: var(--ink);
  outline: none; border-radius: 4px;
}
.field-box:focus { border-color: var(--terra); }

/* footer */
.foot { padding: 80px 24px 32px; border-top: 1px solid var(--line); background: var(--paper); }
.foot-brand { font-family: var(--f-disp); font-style: italic; font-size: clamp(72px, 14vw, 200px); line-height: 0.95; letter-spacing: -0.03em; text-align: center; color: var(--terra); margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.foot-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; max-width: 1320px; margin: 0 auto; }
@media (max-width: 768px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
.foot-cols h4 { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.foot-cols ul { list-style: none; }
.foot-cols li { padding: 4px 0; font-size: 14px; }
.foot-cols a:hover { color: var(--terra); }
.foot-bottom { max-width: 1320px; margin: 48px auto 0; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal-stagger > * { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal-stagger.in > * { opacity: 1; transform: none; }
.reveal-stagger.in > *:nth-child(1) { transition-delay: .04s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: .10s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: .16s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: .22s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: .28s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: .34s; }
.reveal-stagger.in > *:nth-child(7) { transition-delay: .40s; }
.reveal-stagger.in > *:nth-child(8) { transition-delay: .46s; }

/* chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 100px;
  font-family: var(--f-body); font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  transition: all .25s; cursor: pointer;
}
.chip:hover { background: var(--bone); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* tweaks panel */
.tw-panel {
  position: fixed; top: 100px; inset-inline-end: 24px; z-index: 90;
  width: 280px; background: var(--paper);
  border: 1px solid var(--line); padding: 20px;
  border-radius: 16px;
  transform: translateX(120%); opacity: 0;
  transition: transform .4s var(--ease), opacity .25s;
  box-shadow: 0 16px 40px rgba(58,47,36,0.12);
}
.tw-panel.open { transform: none; opacity: 1; }

/* lead time pill (pre-order) */
.lead {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 4px 10px; border-radius: 100px;
  background: color-mix(in srgb, var(--terra) 12%, transparent);
  color: var(--terra-2);
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
}
.lead::before { content: "○"; }
