/* Envido site: tokens, base, and the pieces every page shares (nav, logo
   mark, buttons, labels, footer, back-to-top). Page-specific layout lives in
   src/<page>-extra.css. Light paper sections, black dark sections; one blue
   accent, orange reserved for prices and "by hand" figures. */
:root {
  --black: #000;
  --paper: #fbfbfc;
  --card: #f3f4f6;
  --ink: #121212;
  --muted: #6b7280;
  --text-2: #4b5563;
  --line: rgba(18, 18, 18, .1);
  --on-dark: #f7f8f8;
  --on-dark-2: #d0d6e0;
  --on-dark-muted: #8a8f98;
  --line-dark: rgba(255, 255, 255, .1);

  --accent-l: #2f6fe0;
  --accent-d: #5c9cf5;
  --accent: var(--accent-l);
  --orange-l: #d4870f;
  --orange-d: #f2a33a;
  --orange: var(--orange-l);
  --green: #5fbf6f;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --serif: var(--mono);
}
.dark { --accent: var(--accent-d); --orange: var(--orange-d); background: var(--black); color: var(--on-dark); }

/* 16px up to ~1450px wide, grows to 20px on 2K+ screens */
html { font-size: clamp(16px, calc(8px + .55vw), 20px); scroll-behavior: smooth; scroll-padding-top: 3.5rem; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: max(1440px, 75rem); margin: 0 auto; padding: 0 2.5rem; }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.03em; }
.label { font-family: var(--mono); font-size: .75rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dark .label { color: var(--on-dark-muted); }
.label.accent { color: var(--accent); }

.btn { font-family: var(--mono); display: inline-flex; align-items: center; height: 2.5rem; padding: 0 1.125rem; border-radius: .25rem; font-size: .875rem; font-weight: 500; transition: opacity .15s; }
.btn:hover { opacity: .85; }
.btn-sm { height: 2.125rem; padding: 0 .875rem; font-size: .8125rem; }
.btn-accent { background: var(--accent); color: #fff; }
.dark .btn-accent { color: #061021; }
.btn-light { background: var(--on-dark); color: var(--black); }
.btn-ghost { color: var(--on-dark); background: #262626; }

.logo { display: inline-flex; align-items: baseline; gap: .45rem; }
.mark { display: block; height: .96em; width: auto; transform: translateY(.12em); }
.mark .p2 path { stroke: var(--accent); }

/* nav: fixed on top; transparent over the hero, a dark translucent bar once
   the page scrolls (.scrolled, set in src/_foot.html) */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 40; transition: background .2s, box-shadow .2s; }
nav.scrolled { background: rgba(0, 0, 0, .82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--line-dark); }
nav .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 4.5rem; transition: height .2s; }
/* once scrolled the bar slims down; sticky elements below it use this height */
nav.scrolled .wrap { height: 3.5rem; }
nav .wrap > :last-child { justify-self: end; }
nav .wordmark { justify-self: start; }
.wordmark { font-family: var(--serif); font-size: 1.375rem; font-weight: 500; letter-spacing: -.02em; }
.nav-links { font-family: var(--mono); display: flex; align-items: center; gap: 2rem; font-size: .875rem; color: var(--on-dark-muted); }
.nav-links a:hover { color: var(--on-dark); }
.nav-links a[aria-current] { color: var(--on-dark); }

/* sections */
section { padding: 8rem 0; }
h2.serif { font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.2; }
.lede { font-size: 1.0625rem; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }

/* technical details: corner ticks + tagged label */
.ticked { position: relative; --tick: var(--ink); }
.dark .ticked, .ticked.dark { --tick: var(--on-dark); }
.ticked::before { content: ''; position: absolute; inset: -1px; z-index: 1; pointer-events: none;
  background: linear-gradient(var(--tick), var(--tick)) top left / .75rem 1px, linear-gradient(var(--tick), var(--tick)) top left / 1px .75rem,
    linear-gradient(var(--tick), var(--tick)) bottom right / .75rem 1px, linear-gradient(var(--tick), var(--tick)) bottom right / 1px .75rem;
  background-repeat: no-repeat; }
.tag { font-family: var(--mono); display: flex; align-items: center; gap: .625rem; font-size: .6875rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dark .tag { color: var(--on-dark-muted); }
.tag i { flex: none; width: .4375rem; height: .4375rem; background: var(--accent); }
.tag::after { content: ''; width: 5rem; height: 1px; background: rgba(18, 18, 18, .18); }
.dark .tag::after { background: rgba(255, 255, 255, .2); }

/* flat panels: film grain */
.grain { position: relative; }
.grain::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .07; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.grain > * { position: relative; z-index: 1; }

/* footer */
.site-footer { overflow: hidden; }
.foot-base { background: #000; border-top: 1px solid var(--line-dark); padding-bottom: 2rem; }
.foot-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 2.5rem; padding: 4rem 0; }
.foot-blurb { max-width: 29rem; font-size: .875rem; line-height: 1.6; color: var(--on-dark-muted); }
.foot-blurb .wordmark { display: flex; width: fit-content; color: var(--on-dark); margin-bottom: .75rem; }
.foot-meta { font-family: var(--mono); text-align: right; font-size: .9375rem; line-height: 1.6; color: var(--on-dark-muted); }
.foot-meta a { display: block; color: var(--accent); }
.foot-meta a:hover { color: var(--on-dark); }
.foot-meta .btn { display: inline-flex; margin-top: .75rem; color: #061021; }
.foot-meta .btn:hover { color: #061021; }
.foot-mark { display: block; width: 100%; height: auto; }
.copy { font-family: var(--mono); margin-top: .25rem; text-align: center; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--on-dark-muted); }

.to-top { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 30; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: .25rem;
  background: var(--ink); color: var(--on-dark); border: 1px solid rgba(255, 255, 255, .12); opacity: 0; transform: translateY(.5rem); pointer-events: none; transition: opacity .2s, transform .2s, background .15s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--accent-l); border-color: var(--accent-l); }
.to-top svg { width: .875rem; height: .875rem; }

@media (max-width: 900px) {
  .wrap { padding: 0 1.25rem; }
  .nav-links { display: none; }
  nav .wrap { grid-template-columns: 1fr auto; }
  .foot-row { flex-direction: column; align-items: flex-start; gap: 1.5rem; padding: 3rem 0; }
  .foot-meta { text-align: left; }
}
