/* =========================================================================
   ELAM BUSINESS CONSULTING — design system
   Concept: "Elevation contours" — topographic precision, editorial warmth.
   ========================================================================= */

:root {
  /* Type */
  --font-display: "Newsreader", Georgia, serif;
  --font-sans: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Warm Editorial theme (default) */
  --paper:      #F4EFE6;
  --paper-2:    #ECE5D7;
  --paper-3:    #E3DBC9;
  --ink:        #17222E;
  --ink-soft:   #3E4A55;
  --muted:      #6B7079;
  --navy:       #1C3A52;
  --navy-deep:  #102434;
  --accent:     #46685A;   /* sage / forest */
  --accent-soft:#86A091;
  --accent-ink: #2C4A3D;
  --line:       rgba(23, 34, 46, 0.14);
  --line-soft:  rgba(23, 34, 46, 0.08);
  --on-dark:    #F4EFE6;
  --on-dark-mut:#A9B6BE;

  --r-sm: 4px;
  --r-md: 10px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(16,36,52,.04), 0 12px 32px -16px rgba(16,36,52,.22);
  --shadow-lg: 0 2px 4px rgba(16,36,52,.05), 0 40px 80px -32px rgba(16,36,52,.32);

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
}

/* ---- Theme: Midnight ---- */
[data-theme="midnight"] {
  --paper:      #0F1F2C;
  --paper-2:    #142836;
  --paper-3:    #1B3142;
  --ink:        #F0EBE0;
  --ink-soft:   #C3CDD4;
  --muted:      #8595A0;
  --navy:       #DCE7EC;
  --navy-deep:  #EAF1F4;
  --accent:     #7FA593;
  --accent-soft:#9DBBAB;
  --accent-ink: #C7DAD0;
  --line:       rgba(240, 235, 224, 0.16);
  --line-soft:  rgba(240, 235, 224, 0.09);
  --on-dark:    #F0EBE0;
  --on-dark-mut:#9FB0B9;
}

/* ---- Theme: Paper (cooler, lighter) ---- */
[data-theme="paper"] {
  --paper:      #FBFAF7;
  --paper-2:    #F2F1EC;
  --paper-3:    #E9E8E1;
  --ink:        #15212C;
  --navy:       #1B3A52;
  --line:       rgba(21, 33, 44, 0.12);
  --line-soft:  rgba(21, 33, 44, 0.07);
}

/* ---- Accent override: Clay ---- */
[data-accent="clay"] {
  --accent:     #A4502E;
  --accent-soft:#C98A6B;
  --accent-ink: #7E3C22;
}
[data-theme="midnight"][data-accent="clay"] {
  --accent:     #C97A53;
  --accent-soft:#D89B7D;
  --accent-ink: #E0A98B;
}

/* ---- Accent override: Navy (monochrome) ---- */
[data-accent="navy"] {
  --accent:     #1C3A52;
  --accent-soft:#6E8597;
  --accent-ink: #102434;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  transition: background-color .5s ease, color .5s ease;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------------------------------------------------------- layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 144px); position: relative; }

/* ---------------------------------------------------------- type scale */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.028em;
  font-size: clamp(44px, 7.4vw, 104px);
}
.display em { font-style: italic; color: var(--accent); }

.h-xl { font-family: var(--font-display); font-size: clamp(34px, 4.6vw, 60px); line-height: 1.06; letter-spacing: -0.022em; }
.h-lg { font-family: var(--font-display); font-size: clamp(27px, 3.1vw, 40px); line-height: 1.12; letter-spacing: -0.018em; }
.h-md { font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 28px); line-height: 1.18; }

.lead { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--ink-soft); letter-spacing: -0.01em; }
.body-mut { color: var(--muted); }

.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: none; }
.eyebrow.center::before { display: none; }

.mono-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------- buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 14px 26px;
  border-radius: 100px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .25s cubic-bezier(.2,.7,.3,1), background-color .25s, color .25s, border-color .25s, box-shadow .25s;
  white-space: nowrap;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--navy-deep); box-shadow: var(--shadow); transform: translateY(-1px); }
[data-theme="midnight"] .btn-primary { background: var(--accent); color: #0F1F2C; }
[data-theme="midnight"] .btn-primary:hover { background: var(--accent-soft); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-1px); }

.btn-accent { background: var(--accent); color: var(--paper); }
.btn-accent:hover { background: var(--accent-ink); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn .arrow { transition: transform .3s cubic-bezier(.2,.7,.3,1); }
.btn:hover .arrow { transform: translateX(4px); }

/* text link with animated underline */
.tlink {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1.5px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .35s cubic-bezier(.2,.7,.3,1), color .25s;
  padding-bottom: 2px;
}
.tlink:hover { background-size: 100% 1.5px; color: var(--accent-ink); }
.tlink .arrow { transition: transform .3s; }
.tlink:hover .arrow { transform: translateX(3px); }

/* ---------------------------------------------------------- contour graphic */
.contour {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
}
.contour-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

/* fine ruled hairline */
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* card */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .4s cubic-bezier(.2,.7,.3,1), box-shadow .4s, border-color .3s;
}

/* utility */
.stack { display: flex; flex-direction: column; }
.row { display: flex; }
.center { text-align: center; }
.grid { display: grid; }

/* reveal on scroll — resting state is VISIBLE so content can never be stuck
   hidden if the compositor doesn't tick. JS adds `reveal-on` to <html>, which
   hides un-revealed elements; adding `.in` returns them to the visible base
   (statically, with a transition smoothing it when the tab is actually painting). */
.reveal { opacity: 1; transform: none; }
html.reveal-on .reveal {
  transition: opacity .8s cubic-bezier(.2,.7,.3,1), transform .8s cubic-bezier(.2,.7,.3,1);
  transition-delay: var(--rd, 0ms);
}
html.reveal-on .reveal:not(.in) { opacity: 0; transform: translateY(20px); }
@media (prefers-reduced-motion: reduce) {
  html.reveal-on .reveal:not(.in) { opacity: 1; transform: none; }
}

/* page transition — transform only, never gates visibility */
.page { animation: pageIn .6s cubic-bezier(.2,.7,.3,1) both; }
@keyframes pageIn {
  from { transform: translateY(12px); }
  to   { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
}

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
