/* Andai - holding page styles
   Tokens first, then layout. Light is the default; dark follows the system. */

:root {
  --paper: #f6f4ef;
  --ink: #121212;
  --muted: #615f59;
  --line: #d8d4ca;
  --accent: #2238ff;
  --accent-ink: #ffffff;
  --dot: 18, 18, 18;        /* rgb triplet used by the canvas field */
  --dot-alpha: 0.16;

  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max: 1120px;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f0f10;
    --ink: #f2f0ea;
    --muted: #9d9b94;
    --line: #2a2a2d;
    --accent: #7e88ff;
    --accent-ink: #0f0f10;
    --dot: 242, 240, 234;
    --dot-alpha: 0.14;
  }
}
:root[data-theme="dark"] {
  --paper: #0f0f10;
  --ink: #f2f0ea;
  --muted: #9d9b94;
  --line: #2a2a2d;
  --accent: #7e88ff;
  --accent-ink: #0f0f10;
  --dot: 242, 240, 234;
  --dot-alpha: 0.14;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3, p, ol { margin: 0; }

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  z-index: 10;
}
.skip:focus { top: 16px; }

/* ---------- background field ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site-header, main, .site-footer {
  position: relative;
  z-index: 1;
}

/* ---------- header ---------- */

.site-header {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  padding-block: 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: -0.015em;
  line-height: 1;
}
.wordmark span { color: var(--accent); }

.site-header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.95rem;
  font-weight: 500;
}
.site-header nav a {
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s var(--ease);
}
.site-header nav a:hover { color: var(--ink); }

@media (max-width: 480px) {
  .site-header { gap: 16px; }
  .site-header nav { gap: 16px; font-size: 0.9rem; }
}

.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.theme-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ---------- hero ---------- */

main {
  flex: 1;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.hero {
  min-height: calc(100svh - 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(48px, 8vh, 120px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: clamp(20px, 3vh, 36px);
}

.pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  opacity: 0;
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring {
  0%   { transform: scale(.4); opacity: .9; }
  70%  { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.headline {
  font-family: var(--font-display);
  font-weight: 400;
  /* The minimum is set so the longest phrase ("Your community") still fits on
     one line at a 320px viewport; above that the size tracks the viewport. */
  font-size: clamp(2.9rem, 10.5vw, 8.5rem);
  line-height: 0.96;
  letter-spacing: -0.015em;
}
.headline .and { display: block; }

/* The rotator reserves the height of its tallest phrase (set by script.js) and
   bottom-aligns the current one, so the hero never jumps as the words change. */
.rotator {
  display: flex;
  align-items: flex-end;
  color: var(--accent);
  font-style: italic;
  min-height: 1em;
}
.rotator-word {
  display: inline-block;
  white-space: nowrap;   /* a phrase is always one line, so the hero never reflows */
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  will-change: opacity, transform;
}
.rotator-word.is-leaving {
  opacity: 0;
  transform: translateY(-0.18em);
}
.rotator-word.is-entering {
  opacity: 0;
  transform: translateY(0.18em);
  transition: none;
}

.lede {
  margin-top: clamp(28px, 4vh, 44px);
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  color: var(--muted);
}

.hero-actions {
  margin-top: clamp(28px, 4vh, 40px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  font-size: 0.98rem;
  transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.button:hover {
  background: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.textlink {
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
.textlink:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

/* ---------- sections ---------- */

.section-title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.work { padding-block: clamp(48px, 8vh, 96px) clamp(64px, 10vh, 128px); }

.services {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 48px;
}
.services li {
  position: relative;
  padding: 32px 0 36px 0;
  border-bottom: 1px solid var(--line);
}
.services .num {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 18px;
}
.services h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.services p {
  color: var(--muted);
  max-width: 40ch;
}

@media (min-width: 760px) {
  .services { grid-template-columns: 1fr 1fr; }
  .services li { padding: 40px 0 44px 0; }
}

/* ---------- contact ---------- */

.contact { padding-block: 0 clamp(72px, 12vh, 140px); }

.contact-lede {
  margin-top: 28px;
  max-width: 44ch;
  color: var(--muted);
}

.email {
  display: inline-block;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.2vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  transition: text-decoration-color .25s var(--ease), color .25s var(--ease);
  overflow-wrap: anywhere;
}
.email:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---------- footer ---------- */

.site-footer {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  padding-block: 28px 36px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer a:hover { color: var(--ink); }

/* ---------- 404 ---------- */

.notfound {
  min-height: calc(100svh - 96px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(48px, 8vh, 120px);
}

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse::after { animation: none; }
  .rotator-word { transition: none; }
  .button, .textlink, .email { transition: none; }
}
