/* =========================================================
   APOTEK DAMMFRI — Brand System
   Tokens, type, components
   ========================================================= */

:root {
  /* ---------- Brand color ---------- */
  --navy:        #1F3F6E;  /* primary brand */
  --navy-deep:   #16315A;
  --navy-soft:   #2B5292;
  --navy-tint:   #E4EAF3;  /* surface tint of navy */

  /* ---------- Neutrals (warm) ---------- */
  --ink:         #14213D;  /* primary text */
  --ink-2:       #4A5468;  /* secondary text */
  --ink-3:       #7B8392;  /* tertiary / captions */
  --paper:       #FAFAF7;  /* primary surface (off-white, warm) */
  --paper-2:     #F2F1EC;  /* secondary surface */
  --line:        #E5E3DD;  /* borders / hairlines */
  --line-2:      #D9D6CE;

  /* ---------- Functional ---------- */
  --success:     #4F7A5C;
  --success-bg:  #E8EFE9;
  --warning:     #B47A3A;
  --warning-bg:  #F6ECDC;
  --danger:      #A8493F;
  --danger-bg:   #F4DFDB;

  /* ---------- Radius ---------- */
  --r-0: 0px;
  --r-1: 4px;
  --r-2: 8px;
  --r-3: 12px;
  --r-4: 16px;
  --r-pill: 999px;

  /* ---------- Shadow ---------- */
  --shadow-sm: 0 1px 2px rgba(20,33,61,0.06);
  --shadow-md: 0 4px 16px rgba(20,33,61,0.08);
  --shadow-lg: 0 20px 48px rgba(20,33,61,0.12);

  /* ---------- Page width (shared across overview + routine) ---------- */
  --page-max: 780px;

  /* ---------- Spacing scale (4-based) ---------- */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ---------- Page chrome ---------- */
.page {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.sidebar .brand-mini {
  display: flex; flex-direction: column;
  line-height: 0.95;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.sidebar .brand-mini .light { font-weight: 300; font-size: 14px; letter-spacing: 0.04em; opacity: 0.9; }
.sidebar .brand-mini .heavy { font-weight: 800; font-size: 22px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--r-2);
  letter-spacing: 0.01em;
}
.sidebar nav a:hover { background: var(--paper-2); color: var(--ink); }
.sidebar nav a .num {
  display: inline-block;
  width: 22px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.sidebar .foot {
  margin-top: auto;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.5;
}

.main { padding: 64px 56px 140px; max-width: 1180px; min-width: 0; }

/* ---------- Section header pattern ---------- */
.section { margin-bottom: 120px; scroll-margin-top: 40px; }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before {
  content: ""; display: inline-block; width: 24px; height: 1px;
  background: var(--navy);
}
.h-display {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 4.5vw, 56px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 20px;
}
.h-section {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 16px;
}
.h-sub {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 10px;
}
.lede {
  font-size: 18px;
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 640px;
  margin: 0 0 48px;
}
.muted { color: var(--ink-2); }
.tiny { font-size: 12px; letter-spacing: 0.04em; color: var(--ink-3); text-transform: uppercase; font-weight: 600; }

/* ---------- The wordmark itself ---------- */
.wordmark {
  font-family: 'Manrope', sans-serif;
  color: var(--navy);
  line-height: 0.95;
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: inline-block;
}
.wordmark .light { font-weight: 300; opacity: 0.92; }
.wordmark .heavy { font-weight: 800; }
.wordmark.inv { color: #fff; }

/* ---------- Logo lab ---------- */
.logo-lab {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
}
.logo-tile {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: clamp(40px, 5vw, 64px) clamp(28px, 4vw, 48px);
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  min-height: 280px;
  position: relative;
  overflow: hidden;
  container-type: inline-size;   /* scale wordmark to tile width */
}
.logo-tile.dark { background: var(--navy); border-color: var(--navy); }
.logo-tile.tint { background: var(--paper-2); }
.logo-tile .label {
  position: absolute;
  top: 16px; left: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.logo-tile.dark .label { color: rgba(255,255,255,0.6); }

/* clear space diagram */
.clearspace { position: relative; }
.clearspace .frame {
  position: relative;
  display: inline-block;
  padding: 60px 80px;
  outline: 1px dashed var(--navy-soft);
  outline-offset: 0;
}
.clearspace .x {
  position: absolute;
  background: rgba(31,63,110,0.08);
  border: 1px dashed rgba(31,63,110,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--navy);
  font-family: 'Manrope', sans-serif;
}

/* minimum size strip */
.min-strip {
  display: flex; align-items: flex-end; gap: 40px;
  padding-top: 24px;
}
.min-strip .step { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.min-strip .step .px { font-size: 11px; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 600; }

/* do / don't */
.do-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.do-card {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--paper);
}
.do-card .preview {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--paper-2);
  position: relative;
  overflow: hidden;
}
.do-card .meta {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}
.do-card .meta .badge {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  flex: none;
}
.do-card.yes .badge { background: var(--success); }
.do-card.no .badge { background: var(--danger); }

/* ---------- Color ---------- */
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.swatch {
  border-radius: var(--r-3);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}
.swatch .chip {
  height: 130px;
  display: flex; align-items: flex-end;
  padding: 16px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.swatch .chip.dark { color: #fff; }
.swatch .chip.light { color: var(--ink); }
.swatch .meta {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px;
  border-top: 1px solid var(--line);
}
.swatch .meta .name { font-weight: 700; color: var(--ink); }
.swatch .meta .val  { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }

.color-row-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 32px 0 12px;
}

/* ---------- Type ---------- */
.type-spec {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.type-spec:last-child { border-bottom: 1px solid var(--line); }
.type-spec .label { color: var(--ink-3); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.type-spec .label .px { display: block; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 500; margin-top: 4px; font-size: 12px; }
.type-spec .sample { color: var(--ink); }

.t-display   { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 64px; line-height: 1; letter-spacing: -0.025em; }
.t-h1        { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 44px; line-height: 1.05; letter-spacing: -0.02em; }
.t-h2        { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.t-h3        { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 20px; line-height: 1.25; letter-spacing: -0.005em; }
.t-body      { font-family: 'Manrope', sans-serif; font-weight: 400; font-size: 16px; line-height: 1.6; }
.t-body-em   { font-family: 'Manrope', sans-serif; font-weight: 500; font-size: 16px; line-height: 1.6; }
.t-small     { font-family: 'Manrope', sans-serif; font-weight: 400; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.t-eyebrow   { font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 12px; line-height: 1.2; letter-spacing: 0.22em; text-transform: uppercase; color: var(--navy); }

/* ---------- Spacing scale ---------- */
.scale {
  display: grid;
  grid-template-columns: 80px 100px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.scale:last-child { border-bottom: 1px solid var(--line); }
.scale .name { font-weight: 700; color: var(--ink); font-size: 13px; }
.scale .val { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.scale .bar { background: var(--navy); height: 10px; border-radius: var(--r-1); }

.radius-row { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.radius-row .item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.radius-row .box { width: 96px; height: 96px; background: var(--navy); }
.radius-row .name { font-size: 12px; color: var(--ink-2); font-weight: 600; }

.shadow-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 16px; }
.shadow-row .item {
  background: var(--paper);
  height: 140px;
  border-radius: var(--r-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.shadow-row .item.sm { box-shadow: var(--shadow-sm); }
.shadow-row .item.md { box-shadow: var(--shadow-md); }
.shadow-row .item.lg { box-shadow: var(--shadow-lg); }

/* ---------- Components ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease;
  line-height: 1;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary    { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-deep); }
.btn.secondary  { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn.secondary:hover { background: var(--navy-tint); }
.btn.ghost      { background: transparent; color: var(--ink); }
.btn.ghost:hover{ background: var(--paper-2); }
.btn.danger     { background: var(--danger); color: #fff; }
.btn.sm         { padding: 8px 14px; font-size: 13px; }
.btn.lg         { padding: 16px 28px; font-size: 16px; }
.btn .ic { width: 16px; height: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--ink);
}
.pill.navy    { background: var(--navy-tint); color: var(--navy); }
.pill.success { background: var(--success-bg); color: var(--success); }
.pill.warning { background: var(--warning-bg); color: var(--warning); }
.pill.danger  { background: var(--danger-bg); color: var(--danger); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.input {
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  background: #fff;
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-tint); }
.input::placeholder { color: var(--ink-3); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field .lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 12px; color: var(--ink-3); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 24px;
}

/* component playground grid */
.cmp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.cmp-cell {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  background: var(--paper);
  padding: 28px;
}
.cmp-cell .title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 20px;
}
.cmp-cell .row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cmp-cell + .cmp-cell { /* spacing handled by grid */ }

/* ---------- In-use samples ---------- */
.frame-outer {
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  overflow: hidden;
  background: var(--paper);
}
.frame-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

/* mini website mockup */
.site {
  background: #fff;
  font-family: 'Manrope', sans-serif;
}
.site .nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
}
.site .nav .links { display: flex; gap: 22px; font-size: 14px; color: var(--ink-2); }
.site .nav .links a { font-weight: 500; }
.site .nav .actions { display: flex; gap: 8px; align-items: center; }
.site .hero {
  padding: clamp(40px, 4vw, 64px) clamp(28px, 3.5vw, 48px) clamp(36px, 3.5vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: center;
}
.site .hero h1 {
  font-size: clamp(34px, 4.2vw, 56px); font-weight: 800; line-height: 1.02;
  letter-spacing: -0.025em; margin: 0 0 18px; color: var(--ink);
}
.site .hero h1 em { font-style: normal; color: var(--navy); }
.site .hero p { font-size: 17px; color: var(--ink-2); margin: 0 0 24px; line-height: 1.55; max-width: 460px; }
.site .hero .ctas { display: flex; gap: 10px; }
.site .hero .visual {
  background: var(--navy-tint);
  border-radius: var(--r-4);
  aspect-ratio: 1.05 / 1;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.site .hero .visual .ph {
  font-size: 11px; color: var(--navy-soft); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600;
}
.site .strip {
  background: var(--paper-2);
  padding: 24px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  border-top: 1px solid var(--line);
}
.site .strip .stat { display: flex; flex-direction: column; }
.site .strip .stat .num { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; line-height: 1; }
.site .strip .stat .lbl { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; margin-top: 6px; }
.site .strip .div { width: 1px; height: 36px; background: var(--line-2); }

/* product card */
.product-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.product {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.product .img {
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.product .img .ph { font-size: 10px; color: var(--ink-3); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.product .img .tag { position: absolute; top: 12px; left: 12px; }
.product .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.product .body .name { font-weight: 700; font-size: 15px; color: var(--ink); }
.product .body .sub  { font-size: 12px; color: var(--ink-3); }
.product .body .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.product .body .price { font-weight: 800; font-size: 18px; color: var(--navy); letter-spacing: -0.01em; }

/* receipt */
.receipt {
  background: #fff;
  padding: 28px 28px 24px;
  border-radius: var(--r-3);
  border: 1px solid var(--line);
  max-width: 360px;
}
.receipt .head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px dashed var(--line-2); }
.receipt .head .ref { font-size: 12px; color: var(--ink-3); letter-spacing: 0.04em; }
.receipt .line { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; color: var(--ink-2); }
.receipt .line.total { padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line-2); color: var(--ink); font-weight: 700; }
.receipt .line .name { color: var(--ink); }

/* business card */
.bcard-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.bcard {
  aspect-ratio: 1.75 / 1;
  border-radius: var(--r-2);
  padding: 28px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow-md);
}
.bcard.paper { background: var(--paper); color: var(--ink); }
.bcard.navy  { background: var(--navy);  color: #fff; }
.bcard .name { font-weight: 700; font-size: 15px; letter-spacing: -0.005em; }
.bcard .role { font-size: 12px; color: inherit; opacity: 0.7; margin-top: 2px; }
.bcard .meta { font-size: 12px; line-height: 1.5; opacity: 0.85; }

/* divider helper */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.split-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* hero of the page */
.cover {
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-4);
  padding: clamp(48px, 5vw, 72px) clamp(36px, 5vw, 64px);
  margin-bottom: 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  position: relative;
  overflow: hidden;
}
.cover .kicker {
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 600;
  opacity: 0.7; margin-bottom: 20px;
}
.cover h1 {
  font-size: clamp(40px, 5.4vw, 64px); font-weight: 800; line-height: 1; letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.cover p { font-size: clamp(14px, 1.4vw, 17px); line-height: 1.55; max-width: 520px; opacity: 0.85; margin: 0; }
.cover .stamp {
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 600;
  opacity: 0.7; text-align: right;
}
.cover .stamp strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; opacity: 1; text-transform: none; }
