/* AMPM – ampm.no */

/* Fraunces (SIL Open Font License, see assets/fraunces-LICENSE.txt), self-hosted */
@font-face {
  font-family: "Fraunces";
  src: url("assets/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #131210;
  --paper: #ffffff;
  --muted: #5f5b55;
  --line: #e4e0da;

  --svc-dark: #131210;   /* Apps & AI agents: almost black */
  --svc-light: #e9e1d4;  /* Advisory: warm light grey (logo background) */
  --on-dark: #f4f1ec;

  --gutter: clamp(1rem, 5vw, 4rem);
  --font: "Fraunces", Georgia, "Times New Roman", serif;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
  overflow-x: clip;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}

.skip-link:focus {
  top: 0.5rem;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--gutter);
}

.logo {
  display: block;
  color: var(--ink);
  line-height: 0;
}

.logo svg {
  width: 6.5rem;
  height: auto;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  font-weight: 500;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Intro */

.intro {
  padding: clamp(4rem, 14vh, 10rem) var(--gutter) clamp(4rem, 16vh, 12rem);
}

.intro h1 {
  max-width: 22em;
  font-size: clamp(1.625rem, 3.6vw, 3.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

/* Services – static layout (mobile, reduced motion, no JavaScript) */

.services__aside {
  padding: 0 var(--gutter) 1.5rem;
}

.services__label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.services__counter,
.services__list {
  display: none;
}

.service {
  padding: 3.5rem var(--gutter);
  background: var(--svc-dark);
  color: var(--on-dark);
}

.service[data-theme="light"] {
  background: var(--svc-light);
  color: var(--ink);
}

.service__name {
  font-size: clamp(2.5rem, 11vw, 4rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.service__body {
  max-width: 34em;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
}

.service__body + .service__body {
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .service {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
}

/* Mobile: services fade in when they come into view */

.has-reveal .service {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.has-reveal .service.is-visible {
  opacity: 1;
  transform: none;
}

/* Services – sticky scroll sequence (768 px and up, motion allowed) */

.has-sequence .services {
  height: 250vh;
  background: var(--svc-dark);
  color: var(--on-dark);
  transition: background-color 0.6s ease, color 0.6s ease;
}

.has-sequence .services[data-active="1"] {
  background: var(--svc-light);
  color: var(--ink);
}

.has-sequence .services__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(10rem, 0.7fr) 2.4fr;
  align-items: center;
  column-gap: var(--gutter);
  padding: 0 var(--gutter);
  overflow: hidden;
}

.has-sequence .services__aside {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding: 0;
}

.has-sequence .services__counter {
  display: block;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.has-sequence .services__list {
  display: block;
  list-style: none;
  padding: 0;
  margin-top: 2.5rem;
}

.has-sequence .services__list li + li {
  margin-top: 0.5rem;
}

.has-sequence .services__list a {
  text-decoration: none;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.has-sequence .services__list a:hover,
.has-sequence .services__list a[aria-current="true"] {
  opacity: 1;
}

.has-sequence .service {
  grid-column: 2;
  grid-row: 1;
  padding: 0;
  background: none;
  color: inherit;
  pointer-events: none;
}

.has-sequence .service.is-active {
  pointer-events: auto;
}

.has-sequence .service__name {
  font-size: clamp(3.25rem, 6.25vw, 6.5rem);
}

/* Word-by-word text transition */

.has-sequence .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: calc(var(--i) * 30ms);
}

.has-sequence .service.is-past .w {
  transform: translateY(-20px);
}

.has-sequence .service.is-active .w {
  opacity: 1;
  transform: none;
  /* incoming words wait until most outgoing words have left */
  transition-delay: calc(450ms + var(--i) * 30ms);
}

/* Apps and Contact */

.block {
  padding: clamp(4rem, 12vh, 8rem) var(--gutter) 0;
}

.block__title {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.block__lead {
  max-width: 28em;
  font-size: clamp(1.375rem, 2.6vw, 2.25rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.company {
  display: grid;
  gap: 1.25rem 2rem;
  margin-top: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  max-width: 64rem;
}

.company dt {
  font-size: 0.875rem;
  color: var(--muted);
}

/* Footer */

.site-footer {
  margin-top: clamp(5rem, 14vh, 9rem);
  padding: 2rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

/* Privacy page */

.prose {
  max-width: 40rem;
  padding: clamp(3rem, 10vh, 6rem) var(--gutter) 0;
  box-sizing: content-box;
}

.prose h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 2.5rem;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 2.5rem 0 0.75rem;
}

.prose p + p {
  margin-top: 1rem;
}

.prose .updated {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.875rem;
}

a[href^="tel:"],
a[href^="mailto:"] {
  white-space: nowrap;
}
