:root {
  --bg: #f4f5f7;
  --fg: #0e1116;
  --muted: #5b6270;
  --accent: #2340f5;
  --on-accent: #ffffff;

  --display: "Archivo", system-ui, sans-serif;
  --body: "Public Sans", system-ui, sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --radius: 4px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1116;
  --fg: #eef0f3;
  --muted: #9aa1ad;
  --accent: #5b73ff;
  --on-accent: #0e1116;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2 { margin: 0; font-family: var(--display); font-weight: 800; }
p { margin: 0; text-wrap: pretty; } /* avoids one-word last lines */

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  transition: background-color 200ms ease;
}

.nav.is-scrolled { background: var(--bg); }

.nav-logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  font-stretch: 112%;
}

.nav nav { display: flex; gap: 32px; align-items: center; }
.nav nav a { font-weight: 500; transition: color 150ms ease; }
.nav nav a:hover { color: var(--accent); }

.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--fg);
  background: none;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 150ms ease, color 150ms ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.theme-toggle svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 450ms cubic-bezier(.2, .7, .2, 1), opacity 250ms ease;
}

/* Light shows the moon (go dark); dark shows the sun (go light) */
.icon-sun { opacity: 0; transform: translateY(24px) rotate(-90deg); }
[data-theme="dark"] .icon-sun { opacity: 1; transform: none; }
[data-theme="dark"] .icon-moon { opacity: 0; transform: translateY(-24px) rotate(90deg); }

/* Hero */
.hero {
  /* full screen on PC; shorter on tall phones and tablets so the hero isn't mostly empty */
  min-height: 100vh;
  min-height: min(100svh, 62vw + 240px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 96px var(--gutter) 48px;
}

.wordmark {
  display: flex;
  width: max-content;
  line-height: 0.82;
  font-weight: 900;
  font-size: 12vw; /* script.js resizes it to fill the row */
  letter-spacing: -0.01em;
  user-select: none;
  cursor: default;
}

.wordmark span {
  display: inline-block;
  transition: opacity 500ms ease, transform 700ms cubic-bezier(.2, .7, .2, 1), color 150ms ease;
}
.js .wordmark span { font-stretch: 62%; opacity: 0; transform: translateY(24px); }
.js .wordmark.is-in span { opacity: 1; transform: none; }

.hero-line {
  margin-top: 40px;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  max-width: 48ch;
}

/* Services */
.services { padding: 128px var(--gutter) 48px; }

.services h2 {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--body);
  color: var(--muted);
  margin-bottom: 24px;
}

.service-list { list-style: none; margin: 0; padding: 0; }

.service-list li {
  padding: 20px 16px;
  margin-inline: -16px;
  border-radius: var(--radius);
  transition: background-color 180ms ease, color 180ms ease;
}

.service-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 5rem);
  line-height: 1;
  font-stretch: 70%;
  transition: font-stretch 400ms cubic-bezier(.2, .7, .2, 1);
}

/* Hover-only effects (no sticky highlight after a tap) */
@media (hover: hover) {
  .wordmark span:hover { color: var(--accent); }
  .service-list li:hover { background: var(--accent); color: var(--on-accent); }
  .service-list li:hover .service-name { font-stretch: 125%; }
}

/* Footer */
.footer {
  padding: 64px var(--gutter) 40px;
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: center;
}

.company { font-style: normal; line-height: 1.7; text-wrap: balance; }
.company a { transition: color 150ms ease; }
.company a:hover { color: var(--fg); }

.copyright { margin-top: 24px; font-size: 0.8125rem; }

/* Pixel cursor (PC only, set up in script.js) */
.pixel-cursor,
.pixel-cursor .wordmark { cursor: var(--cursor-arrow); }
.pixel-cursor a,
.pixel-cursor button,
.pixel-cursor .egg { cursor: var(--cursor-hand); }

/* Scroll reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 600ms ease, transform 800ms cubic-bezier(.2, .7, .2, 1);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Easter egg */
.egg-trigger {
  margin-left: 4px;
  padding: 2px 4px;
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 150ms ease;
}
.egg-trigger:hover { color: var(--fg); }

.egg {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: min(336px, calc(100vw - 32px));
  image-rendering: pixelated;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 300ms ease, transform 300ms ease;
}
.egg.is-on { opacity: 1; transform: none; pointer-events: auto; }

/* Touch: 44px tap targets */
@media (pointer: coarse) {
  .nav-logo, .nav nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .theme-toggle { width: 44px; height: 44px; }
  .company a { display: inline-block; padding: 14px 8px; margin-block: -8px; }
  .egg-trigger { padding: 14px 8px; margin: -14px 0 -14px -4px; } /* 44px tap area without a wide gap */
}

/* Mobile */
@media (max-width: 640px) {
  .nav nav { gap: 16px; }
}

/* Small phones (320px wide) */
@media (max-width: 359px) {
  .nav-logo { font-size: 1.125rem; }
  .nav nav { gap: 10px; }
  .nav nav a { font-size: 0.9375rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .wordmark span { opacity: 1; transform: none; transition: none; }
  .theme-toggle svg { transition: none; }
  .service-name { transition: none; }
  .egg { transition: none; }
}
