/* ============================================================
   UPSIDE PROPERTY — Design tokens & base
   Prototype rebuild · design language adapted from client reference
   ============================================================ */

:root {
  /* ---- Brand palette ---- */
  --ink: #0a0a0a;
  --ink-2: #111111;
  --ink-3: #1a1a1a;
  --paper: #f6f5f3;
  --paper-2: #ffffff;
  --mist: #eceae7;
  --mist-2: #e2dfdb;

  --accent: #f5be8f;
  --accent-2: #efb27e;
  --accent-deep: #d9955c;
  --accent-soft: rgba(245, 190, 143, 0.16);

  /* Navy pulled from the Upside brand mark */
  --navy: #1b2a4a;
  --navy-2: #24365c;

  /* ---- Text ---- */
  --tx: #101010;
  --tx-2: #54514c;
  --tx-3: #8b8781;
  --tx-inv: #ffffff;
  --tx-inv-2: rgba(255, 255, 255, 0.66);
  --tx-inv-3: rgba(255, 255, 255, 0.42);

  /* ---- Lines & glass ---- */
  --line: rgba(10, 10, 10, 0.10);
  --line-2: rgba(10, 10, 10, 0.18);
  --line-inv: rgba(255, 255, 255, 0.14);
  --line-inv-2: rgba(255, 255, 255, 0.26);
  --glass: rgba(250, 249, 247, 0.62);
  --glass-dark: rgba(16, 16, 16, 0.34);
  --glass-chip: rgba(255, 255, 255, 0.30);

  /* ---- Radii ---- */
  --r-xs: 6px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  /* ---- Shadow ---- */
  --sh-sm: 0 2px 10px rgba(10, 10, 10, 0.06);
  --sh-md: 0 14px 40px rgba(10, 10, 10, 0.10);
  --sh-lg: 0 34px 80px rgba(10, 10, 10, 0.16);

  /* ---- Type ---- */
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", serif;

  /* ---- Frame ---- */
  --frame-w: 1440px;
  --gut: 48px;
  --nav-h: 68px;
}

/* ============================================================
   Reset
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--tx);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img,
svg,
video { display: block; max-width: 100%; }

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

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

button { background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

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

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   Typography scale
   ============================================================ */
.h-display,
.h1, .h2, .h3, .h4 {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); }
.h2 { font-size: clamp(2.05rem, 4.4vw, 3.7rem); }
.h3 { font-size: clamp(1.5rem, 2.6vw, 2.3rem); letter-spacing: -0.028em; line-height: 1.1; }
.h4 { font-size: clamp(1.15rem, 1.7vw, 1.5rem); letter-spacing: -0.02em; line-height: 1.2; }

/* italic serif accent used inside headlines */
.em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding-right: 0.04em;
}

.lead {
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  color: var(--tx-2);
  line-height: 1.68;
  max-width: 46ch;
}

.body-sm { font-size: 0.9rem; line-height: 1.62; color: var(--tx-2); }
.body-xs { font-size: 0.8rem; line-height: 1.55; color: var(--tx-3); }

/* fine uppercase micro-label with a bullet, e.g. "• NAVIGATION" */
.micro {
  font-family: var(--f-body);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tx-3);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.micro::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  opacity: 0.8;
}

/* "// small note" comment style */
.comment {
  font-family: var(--f-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tx-3);
}

.comment::before { content: "// "; opacity: 0.55; }

.on-dark .micro, .on-dark .comment,
.dark .micro, .dark .comment { color: var(--tx-inv-3); }

.on-dark, .dark { color: var(--tx-inv); }
.on-dark .lead, .dark .lead { color: var(--tx-inv-2); }

/* section index, e.g. /01 */
.idx {
  font-family: var(--f-body);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--tx-3);
}

/* ============================================================
   Layout
   ============================================================ */
.frame {
  width: 100%;
  max-width: var(--frame-w);
  margin: 26px auto;
  background: var(--paper);
  border-radius: var(--r-xl);
  overflow: clip;
  box-shadow: var(--sh-lg);
  position: relative;
}

.shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gut);
}

.section { padding: clamp(56px, 7.5vw, 108px) 0; }
.section-sm { padding: clamp(38px, 4.6vw, 64px) 0; }
.dark { background: var(--ink); color: var(--tx-inv); }
.white { background: var(--paper-2); }

.stack-xs { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 18px; }
.stack-md { display: flex; flex-direction: column; gap: 28px; }
.stack-lg { display: flex; flex-direction: column; gap: 48px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.hr { height: 1px; background: var(--line); border: 0; margin: 0; }
.dark .hr, .hr-inv { background: var(--line-inv); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -80px;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  transition: top 0.2s ease;
}

.skip-link:focus { top: 12px; }

/* ============================================================
   Responsive gutters
   ============================================================ */
@media (max-width: 900px) {
  :root { --gut: 24px; --frame-w: 100%; }
  .frame { margin: 0; border-radius: 0; box-shadow: none; }
}

@media (max-width: 560px) {
  :root { --gut: 18px; }
  body { font-size: 15px; }
}

/* ============================================================
   Motion preferences
   ============================================================ */
@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;
  }
}
