:root {
  --paper: #eef0ea;
  --ink: #17191a;
  --muted: #5d625e;
  --rule: #cbd0c6;
  --cobalt: #2e3bd1;

  --sans: "Schibsted Grotesk", system-ui, sans-serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 86rem;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; }
p, dd { margin: 0; }
a { color: inherit; }

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

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
}
.skip:focus { left: 0.5rem; z-index: 10; }

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}

.wordmark {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--cobalt); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: var(--ink);
  font: 500 1rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 0.3em;
  padding: 0.25rem;
}

/* Hero: a dictionary entry. The giant word is the one loud thing on the page. */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) var(--gutter) clamp(4rem, 10vh, 7rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
}

.word {
  grid-column: 1 / -1;
  font-weight: 800;
  font-size: clamp(6rem, 27vw, 25rem);
  line-height: 0.82;
  letter-spacing: -0.075em;
  margin-left: -0.06em;
  white-space: nowrap;
}

.caret {
  display: inline-block;
  width: 0.06em;
  height: 0.68em;
  margin-left: 0.06em;
  background: var(--cobalt);
  vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.entry {
  grid-column: 1 / span 4;
  margin-top: clamp(2rem, 5vh, 3.5rem);
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.entry-head { color: var(--muted); }
.entry-head em { font-style: italic; }
.pron { margin-right: 0.5rem; color: var(--ink); }

.entry-def {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  max-width: 22rem;
}

.hero-copy {
  grid-column: 7 / -1;
  margin-top: clamp(2rem, 5vh, 3.5rem);
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.lede {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1.15rem;
  color: var(--muted);
}

.btn {
  display: inline-block;
  margin-top: 2rem;
  background: var(--cobalt);
  color: var(--paper);
  font-weight: 500;
  text-decoration: none;
  padding: 0.85rem 1.4rem;
  transition: background 0.2s;
}
.btn:hover { background: var(--ink); }

/* Sections share a 12-column grid: heading in the left 3, content from column 4. */

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 10vh, 7rem) var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5rem;
}

.section > h2 {
  grid-column: 1 / span 3;
  font-weight: 500;
  font-size: 1rem;
  color: var(--muted);
  padding-top: 0.35rem;
}

.section > :not(h2) { grid-column: 4 / -1; }

/* Work */

.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}

.projects a {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(7rem, auto);
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}

.project-name {
  font-weight: 700;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
}
.project-desc, .project-meta { color: var(--muted); }
.project-meta { text-align: right; }

.projects a:hover .project-name { color: var(--cobalt); }
.projects a:hover .project-name::after { content: "↗"; margin-left: 0.3em; font-weight: 400; }

/* Services */

.services {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.75rem 2.5rem;
}

.services dt {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.services dd { color: var(--muted); max-width: 30rem; }

/* Process: a real sequence, so it is numbered */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.steps li {
  counter-increment: step;
  padding-top: 1rem;
  border-top: 2px solid var(--ink);
}

.steps li::before {
  content: counter(step);
  display: block;
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--cobalt);
  margin-bottom: 1.25rem;
}

.steps h3 { font-weight: 700; font-size: 1.2rem; }
.steps .step-time { color: var(--cobalt); font-weight: 500; margin: 0.15rem 0 0.6rem; }
.steps p { color: var(--muted); font-size: 0.98rem; }

/* Contact */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(5rem, 14vh, 9rem) var(--gutter);
}

.contact > * { max-width: var(--max); margin-left: auto; margin-right: auto; }

.contact h2 {
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: min(var(--max), 18ch);
  margin-left: 0;
}

.contact-mail {
  display: inline-block;
  margin-top: 2.5rem;
  font-weight: 800;
  font-size: clamp(2rem, 7.5vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.2s;
}
.contact-mail:hover { color: #8f97ff; }

.contact p { margin-top: 1.5rem; color: #a9aea8; }

/* Footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
  background: var(--ink);
  color: #a9aea8;
  font-size: 0.9rem;
  border-top: 1px solid #33373a;
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--paper); }

/* Responsive */

@media (max-width: 960px) {
  .entry { grid-column: 1 / span 5; }
  .hero-copy { grid-column: 7 / -1; }
  .section > h2 { grid-column: 1 / -1; margin-bottom: 2rem; }
  .section > :not(h2) { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .entry, .hero-copy { grid-column: 1 / -1; }
  .hero-copy { margin-top: 2.5rem; }

  .projects a {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem 1rem;
  }
  .project-desc { grid-column: 1 / -1; grid-row: 2; }

  .services { grid-template-columns: 1fr; gap: 2rem; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem var(--gutter) 2rem;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .btn, .contact-mail { transition: none; }
}
