/* =========================================================
   mikeryan.cc — design tokens
   One type scale. One spacing rhythm. No per-element clamps.
   ========================================================= */
:root {
  /* palette */
  --bg: #faf8f5;
  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --muted: #6b6b6b;
  --line: #e7e4df;
  --dark: #0a0a0a;
  --dark-fg: #ffffff;

  /* type */
  --display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;

  /* type scale — 6 steps, no surprises */
  --fs-label: 11px;    /* mono eyebrow, tiny UI text */
  --fs-sm: 14px;       /* nav, small copy */
  --fs-body: 17px;     /* paragraphs, pillar/principle body */
  --fs-md: 22px;       /* subtitles */
  --fs-lg: 36px;       /* pillar/principle titles */
  --fs-xl: 64px;       /* section headlines */
  --fs-xxl: 96px;      /* hero headline */

  /* weights — only 3 */
  --w-reg: 400;
  --w-med: 600;
  --w-black: 900;

  /* layout */
  --max: 1240px;
  --gutter: clamp(24px, 4vw, 56px);
  --space-section: clamp(88px, 11vh, 144px);
  --space-section-tight: clamp(64px, 8vh, 96px);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 720px) {
  :root {
    --fs-lg: 28px;
    --fs-xl: 44px;
    --fs-xxl: 56px;
  }
}

/* =========================================================
   reset + base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-weight: var(--w-reg);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }

/* Subtle grain overlay — adds tactile feel without distracting */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  mix-blend-mode: multiply;
}

/* =========================================================
   section primitives
   ========================================================= */
.section {
  position: relative;
  padding: var(--space-section) var(--gutter);
}
.section__inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
}

/* Oversized section number — sits in the left margin on desktop */
.section__number {
  position: absolute;
  top: -0.15em;
  left: -0.18em;
  font-family: var(--display);
  font-size: 220px;
  font-weight: var(--w-black);
  line-height: 0.9;
  color: rgba(10, 10, 10, 0.05);
  letter-spacing: -0.06em;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  display: none;
}
@media (min-width: 1100px) { .section__number { display: block; } }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: var(--w-reg);
  margin: 0;
}
.section__title {
  font-size: var(--fs-xl);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: var(--w-black);
  margin: 20px 0 56px;
  max-width: 18ch;
  position: relative;
  z-index: 1;
}
.section__lede {
  color: var(--muted);
  font-size: var(--fs-body);
  margin: -40px 0 48px;
  max-width: 52ch;
}

/* =========================================================
   scroll progress bar
   ========================================================= */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--ink);
  z-index: 60;
  transition: background 0.3s var(--ease);
}

/* =========================================================
   nav
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--gutter);
  color: #fff;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 100%);
  z-index: -1;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.nav--inverted {
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.nav--inverted::before { opacity: 0; }
.nav__brand {
  font-weight: var(--w-black);
  letter-spacing: -0.02em;
  font-size: var(--fs-sm);
}
.nav__links { display: flex; gap: 28px; font-size: var(--fs-sm); }
.nav__links a { opacity: 0.85; transition: opacity 0.2s var(--ease); }
.nav__links a:hover { opacity: 1; }
@media (max-width: 640px) {
  .nav__links { gap: 16px; font-size: 12px; }
}

/* =========================================================
   hero
   ========================================================= */
.section--hero {
  height: 100vh;
  min-height: 560px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: #000;
}
.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero__scrim {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.55) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter) clamp(72px, 12vh, 128px);
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}
.hero__kicker { color: rgba(255,255,255,0.75); margin-bottom: 20px; }
.hero__title {
  font-size: var(--fs-xxl);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: var(--w-black);
  margin: 0;
  max-width: 14ch;
}
.hero__scroll {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  z-index: 2;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  display: none;
  gap: 8px;
}
@media (min-width: 900px) { .hero__scroll { display: inline-flex; } }

/* =========================================================
   sticky rail
   ========================================================= */
.rail {
  position: fixed;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  z-index: 40;
  pointer-events: none;
  color: rgba(255,255,255,0.7);
  transition: color 0.3s var(--ease);
}
.rail--inverted { color: rgba(10,10,10,0.45); }
.rail__label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
@media (max-width: 1100px) { .rail { display: none; } }

/* =========================================================
   proof
   ========================================================= */
.section--proof { padding-bottom: var(--space-section-tight); }
.proof {
  list-style: none;
  margin: 32px 0 0;
  padding: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line);
}
.proof__item { display: flex; flex-direction: column; gap: 10px; }
.proof__num {
  font-size: var(--fs-xl);
  line-height: 0.95;
  font-weight: var(--w-black);
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
}
.proof__sub {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.proof__note {
  margin: 32px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  max-width: 52ch;
}
@media (max-width: 720px) {
  .proof { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   ticker (between proof and services)
   ========================================================= */
.ticker {
  background: #f0ede7;
  color: var(--ink);
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  min-height: 56px;
}
.ticker__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.24em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker__dot {
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: ticker-pulse 1.8s ease-out infinite;
}
@keyframes ticker-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.ticker__feed {
  position: relative;
  flex: 1;
  height: 20px;
  overflow: hidden;
}
.ticker__event {
  position: absolute;
  inset: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  font-variant-numeric: tabular-nums;
}
.ticker__event.is-active { opacity: 1; transform: translateY(0); }
@media (max-width: 640px) {
  .ticker__label { display: none; }
  .ticker { font-size: 12px; padding: 12px var(--gutter); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__dot { animation: none; }
}

/* =========================================================
   services (3-column pillars)
   ========================================================= */
.pillars {
  list-style: none;
  padding: 40px 0 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
}
.pillar {
  padding: 0 28px 0 0;
  border-right: 1px solid var(--line);
}
.pillar:last-child { border-right: 0; padding-right: 0; }
.pillar__num {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
}
.pillar__title {
  font-size: var(--fs-lg);
  letter-spacing: -0.02em;
  font-weight: var(--w-black);
  margin: 0 0 14px;
  line-height: 1.1;
}
.pillar__body {
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: 1.55;
  margin: 0;
}
@media (max-width: 860px) {
  .pillars { grid-template-columns: 1fr; gap: 0; }
  .pillar { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 0; }
  .pillar:last-child { border-bottom: 0; }
}

/* =========================================================
   principles (same pattern as pillars)
   ========================================================= */
.section--principles { background: var(--bg); }
.principles {
  list-style: none;
  padding: 40px 0 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
}
.principle {
  padding: 0 28px 0 0;
  border-right: 1px solid var(--line);
}
.principle:last-child { border-right: 0; padding-right: 0; }
.principle__num {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
}
.principle__title {
  font-size: var(--fs-lg);
  letter-spacing: -0.02em;
  font-weight: var(--w-black);
  margin: 0 0 14px;
  line-height: 1.1;
}
.principle__body {
  color: var(--ink-soft);
  font-size: var(--fs-body);
  line-height: 1.55;
  margin: 0;
}
@media (max-width: 860px) {
  .principles { grid-template-columns: 1fr; gap: 0; }
  .principle { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 0; }
  .principle:last-child { border-bottom: 0; }
}

/* =========================================================
   stack marquee
   ========================================================= */
.section--stack { padding-bottom: 0; }
.marquee {
  margin-top: 48px;
  overflow: hidden;
  padding: 48px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
}
.marquee__track {
  display: inline-flex;
  gap: 72px;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 100%;
  animation: marquee 42s linear infinite;
  will-change: transform;
}
.marquee__logo {
  height: 40px;
  width: auto;
  opacity: 0.85;
  transition: opacity 0.3s var(--ease);
  flex-shrink: 0;
}
.marquee__logo:hover { opacity: 1; }
.marquee__wordmark {
  font-size: 36px;
  font-weight: var(--w-black);
  letter-spacing: -0.04em;
  color: var(--ink);
  opacity: 0.85;
  flex-shrink: 0;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* =========================================================
   about
   ========================================================= */
.about {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
  padding: 40px 0 0;
  border-top: 1px solid var(--line);
}
.about__portrait {
  width: 200px; height: 200px;
  background: #efece6;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 64px;
  font-weight: var(--w-black);
  letter-spacing: -0.05em;
  color: var(--ink-soft);
}
.about__body p {
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 24px;
  max-width: 58ch;
  font-weight: var(--w-reg);
  letter-spacing: -0.01em;
}
.about__link {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
  transition: opacity 0.2s var(--ease);
}
.about__link:hover { opacity: 0.7; }
@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .about__portrait { width: 140px; height: 140px; font-size: 44px; }
}

/* =========================================================
   contact (dark bookend)
   ========================================================= */
.section--contact {
  background: var(--dark);
  color: var(--dark-fg);
  padding-top: clamp(96px, 14vh, 176px);
  padding-bottom: clamp(96px, 14vh, 176px);
}
.eyebrow--light { color: rgba(255,255,255,0.55); }
.section__title--light { color: #fff; }

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 24px;
  margin-top: 32px;
  max-width: 720px;
}
.field { display: flex; flex-direction: column; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}
.field__input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font: inherit;
  font-size: var(--fs-md);
  padding: 10px 0;
  outline: none;
  transition: border-color 0.2s var(--ease);
  font-family: var(--display);
  resize: vertical;
}
.field__input:focus { border-bottom-color: #fff; }

.contact-form__btn {
  grid-column: 1 / -1;
  justify-self: start;
  background: #fff;
  color: #000;
  border: 0;
  padding: 16px 28px;
  font-family: var(--display);
  font-size: var(--fs-sm);
  font-weight: var(--w-black);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
.contact-form__btn:hover { transform: translateY(-2px); background: #eaeaea; }

.contact-alt {
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.contact-alt a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.4); }

@media (max-width: 640px) {
  .contact-form { grid-template-columns: 1fr; }
}

/* =========================================================
   footer
   ========================================================= */
.footer {
  background: var(--bg);
  color: var(--muted);
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.footer__links { display: flex; gap: 28px; }
.footer__links a:hover { color: var(--ink); }
