/* Newton's Jewelers base: reset, type, layout primitives, buttons, media slots.
   Depends on tokens.css. Framework-agnostic; ports to a Shopify theme or Astro as-is. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nj-header-h) + 16px); }
body {
  margin: 0;
  background: var(--nj-pearl);
  color: var(--nj-charcoal);
  font-family: var(--nj-font-text);
  font-weight: 300;
  font-size: var(--nj-size-body);
  line-height: var(--nj-leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--nj-steel); color: var(--nj-ink); }
:focus-visible { outline: 1.5px solid var(--nj-steel-deep); outline-offset: 3px; }

/* Lenis smooth scroll hooks */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* Type */
h1, h2, h3, h4 {
  font-family: var(--nj-font-display);
  font-weight: 400;
  color: var(--nj-ink);
  margin: 0;
  line-height: var(--nj-leading-display);
  letter-spacing: var(--nj-tracking-display);
  text-wrap: balance;
}
h1, .nj-h1 { font-size: var(--nj-size-h1); }
h2, .nj-h2 { font-size: var(--nj-size-h2); }
h3, .nj-h3 { font-size: var(--nj-size-h3); line-height: 1.12; }
.nj-soft { color: var(--nj-steel-deep); }          /* second line of a two-tone headline */
.nj-lead { font-size: var(--nj-size-lead); line-height: 1.6; color: var(--nj-charcoal); max-width: var(--nj-measure); }
.nj-body p + p { margin-top: 1em; }
.nj-body { max-width: var(--nj-measure); }
.nj-statement {
  font-family: var(--nj-font-display);
  font-size: var(--nj-size-statement);
  line-height: 1.16;
  color: var(--nj-ink);
  text-wrap: balance;
}
.nj-label {
  font-family: var(--nj-font-text);
  font-weight: 400;
  font-size: var(--nj-size-caption);
  letter-spacing: var(--nj-tracking-caps);
  text-transform: uppercase;
  color: var(--nj-text-2);
  line-height: 1.5;
}
.nj-label--steel { color: var(--nj-steel-deep); }
.nj-label--dot { display: inline-flex; align-items: center; gap: 12px; }
.nj-label--dot::before {
  content: ""; width: 7px; height: 7px; transform: rotate(45deg);
  border: 1px solid var(--nj-steel); background: transparent; flex: none;
}
.nj-num { font-variant-numeric: tabular-nums lining-nums; }

/* Layout */
.nj-wrap { width: 100%; max-width: var(--nj-max); margin-inline: auto; padding-inline: var(--nj-gutter); }
.nj-sec { padding-block: var(--nj-section); }
.nj-sec--mist { background: var(--nj-mist); }
.nj-sec--white { background: var(--nj-white); }
.nj-sec--steel { background: var(--nj-steel); color: var(--nj-steel-ink); }
.nj-sec--steel h2, .nj-sec--steel h3, .nj-sec--steel .nj-statement { color: var(--nj-ink); }
.nj-sec--steel .nj-label { color: var(--nj-steel-ink); }
.nj-sec-head {
  display: grid; gap: var(--nj-gap-3) var(--nj-gap-5);
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: end; margin-bottom: clamp(40px, 5vw, 72px);
}
.nj-sec-head > * { min-width: 0; }
.nj-sec-head .nj-label { display: flex; margin-bottom: 18px; }
.nj-sec-head p:not(.nj-label) { max-width: 46ch; color: var(--nj-text-2); }
@media (max-width: 860px) { .nj-sec-head { grid-template-columns: 1fr; } }

/* Buttons */
.nj-btn {
  --bg: var(--nj-ink); --fg: var(--nj-white); --bd: var(--nj-ink);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 50px; padding: 14px 28px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bd); border-radius: var(--nj-radius);
  font-family: var(--nj-font-text); font-weight: 400; font-size: var(--nj-size-caption);
  letter-spacing: var(--nj-tracking-caps); text-transform: uppercase; white-space: nowrap;
  overflow: hidden; isolation: isolate;
  transition: color var(--nj-dur) var(--nj-ease), border-color var(--nj-dur) var(--nj-ease), transform var(--nj-dur-fast) var(--nj-ease-press);
}
.nj-btn::after { /* light sweep */
  content: ""; position: absolute; inset: -1px; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 900ms var(--nj-ease);
}
.nj-btn:hover::after { transform: translateX(120%); }
.nj-btn:active { transform: scale(.98); }
.nj-btn--ghost { --bg: transparent; --fg: var(--nj-ink); --bd: rgba(46,46,54,.28); }
.nj-btn--ghost::before {
  content: ""; position: absolute; inset: 0; z-index: -2; background: var(--nj-ink);
  transform: scaleY(0); transform-origin: bottom; transition: transform var(--nj-dur) var(--nj-ease);
}
.nj-btn--ghost:hover { --fg: var(--nj-white); border-color: var(--nj-ink); }
.nj-btn--ghost:hover::before { transform: scaleY(1); }
.nj-btn--light { --bg: var(--nj-white); --fg: var(--nj-ink); --bd: var(--nj-white); }
.nj-btn svg { width: 16px; height: 16px; flex: none; transition: transform var(--nj-dur) var(--nj-ease); }
.nj-btn:hover svg { transform: translateX(4px); }
.nj-btns { display: flex; flex-wrap: wrap; gap: 12px; }

.nj-link {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 400; font-size: var(--nj-size-caption); letter-spacing: var(--nj-tracking-caps); text-transform: uppercase;
  color: var(--nj-ink); padding-block: 6px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size var(--nj-dur) var(--nj-ease), color var(--nj-dur-fast);
}
.nj-link:hover { background-size: 0 1px; background-position: 100% 100%; color: var(--nj-steel-deep); }
.nj-link svg { width: 15px; height: 15px; transition: transform var(--nj-dur) var(--nj-ease); }
.nj-link:hover svg { transform: translateX(4px); }

/* Icons drawn at 1px, like the logo's diamond outline */
.nj-ic { width: 30px; height: 30px; color: var(--nj-steel-deep); stroke-width: 1; }

/* Media slots. To add a photo: set the img src and remove `hidden`; the placeholder hides itself.
   For video: put a <video muted loop playsinline autoplay poster> in place of the img. */
.nj-media { position: relative; margin: 0; overflow: hidden; background: var(--nj-frost); max-width: 100%; }
.nj-media > img, .nj-media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.nj-media > img:not([hidden]) ~ .nj-ph, .nj-media > video ~ .nj-ph { display: none; }
.nj-ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(120% 80% at 28% 18%, rgba(255,255,255,.95), rgba(255,255,255,0) 55%),
    radial-gradient(90% 70% at 80% 100%, rgba(154,177,195,.35), rgba(154,177,195,0) 60%),
    linear-gradient(160deg, #F4F7F9 0%, #E2EAF0 60%, #D3DDE5 100%);
}
.nj-ph svg { width: 38px; height: 38px; color: var(--nj-steel); stroke-width: .8; }
.nj-ph-label {
  position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--nj-muted);
}
.nj-media > img:not([hidden]) ~ .nj-ph-label, .nj-media > video ~ .nj-ph-label { display: none; }
.nj-ratio-45 { aspect-ratio: 4 / 5; }
.nj-ratio-34 { aspect-ratio: 3 / 4; }
.nj-ratio-11 { aspect-ratio: 1; }
.nj-ratio-32 { aspect-ratio: 3 / 2; }
.nj-ratio-169 { aspect-ratio: 16 / 9; }

/* Skip link */
.nj-skip {
  position: absolute; left: 16px; top: -80px; z-index: 100; padding: 12px 18px;
  background: var(--nj-ink); color: var(--nj-white); font-size: var(--nj-size-small);
}
.nj-skip:focus { top: 12px; }

.nj-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
