/* =========================================================
   RVL-CPH — styles
   Palette: warm off-white, sage, patina, deep forest, beige
   Type: Schibsted Grotesk (display/UI) + Newsreader (prose)
   Signature: topographic contour linework
   ========================================================= */

:root {
  --paper:      #F5F2EA;
  --paper-2:    #EFEADD;
  --sand:       #E7DFCF;
  --sage:       #93A286;
  --patina:     #4E7C64;
  --patina-deep:#3C6651; /* accessible accent for small text */
  --forest:     #1F352A;
  --forest-2:   #16271F;
  --ink:        #2C2A24;
  --muted:      #66645A;
  --line:       rgba(31, 53, 42, 0.14);
  --line-soft:  rgba(31, 53, 42, 0.08);
  --muted-sand: #5C5A50; /* accessible muted text on the beige --sand surface */
  --error:      #9C3A24; /* warm clay red, harmonised with the palette */

  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Newsreader", Georgia, "Times New Roman", serif;

  --maxw: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4.5rem, 9vw, 8.5rem);
  --nav-h: 80px;

  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: var(--sand); color: var(--forest); }

:focus-visible {
  outline: 2px solid var(--patina-deep);
  outline-offset: 3px;
  border-radius: 3px;
}
/* On dark surfaces the patina ring is too low-contrast (WCAG 1.4.11) — switch to paper. */
.footer :focus-visible,
.btn--solid:focus-visible,
.skip-link:focus-visible,
.band :focus-visible {
  outline-color: var(--paper);
}

.skip-link {
  position: absolute;
  left: 1rem; top: -60px;
  z-index: 200;
  background: var(--forest);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- typography helpers ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--forest);
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--patina-deep);
  margin-bottom: 1.1rem;
}
.hero .eyebrow {
  font-size: clamp(1.05rem, 1.3vw, 1.15rem);
  letter-spacing: 0.2em;
  margin-bottom: 1.4rem;
}

.lead {
  font-size: clamp(1.125rem, 1.4vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink);
  text-wrap: pretty;
}

.section__title {
  font-size: clamp(1.85rem, 3.6vw, 2.9rem);
}

/* ---------- layout ---------- */
.section { padding: var(--section-y) 0; }
.section[id],
.hero[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }
.section__inner,
.nav__inner,
.band__inner,
.footer__inner,
.footer__base {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section__head { max-width: 60ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__intro { color: var(--muted); margin-top: 1rem; max-width: 52ch; }
.section .eyebrow {
  margin-bottom: 0.65rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 0.85rem 1.5rem;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn--solid {
  background: var(--forest);
  color: var(--paper);
}
.btn--solid:hover { background: #2B4A39; transform: translateY(-2px); }
.btn--solid:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--forest); transform: translateY(-2px); }
.btn:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
              border-color 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--nav-h);
}
.nav.is-scrolled,
.nav.is-menu-open {
  background: rgba(245, 242, 234, 0.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--line-soft);
  box-shadow: 0 1px 8px rgba(31, 53, 42, 0.08);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--forest);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
}
.wordmark__mark { color: var(--patina); display: inline-flex; }
.wordmark__img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.wordmark__copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.wordmark__subline {
  margin-top: 0.3rem;
  color: var(--patina-deep);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}
.wordmark__dot { color: var(--patina); }
.wordmark--light { color: var(--paper); }
.wordmark--light .wordmark__dot { color: var(--sage); }

.nav__links {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}
.nav__link {
  position: relative;
  font-family: var(--font-display);
  font-size: 0.94rem;
  text-decoration: none;
  color: var(--ink);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: color 0.2s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.3rem;
  height: 1.5px;
  background: var(--patina);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav__link:hover { color: var(--forest); }
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--forest); }

.nav__cta { padding: 0.6rem 1.15rem; font-size: 0.9rem; }

.nav__toggle {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px;
  background: none; border: none; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 5px;
  align-items: center;
}
.nav__toggle span {
  width: 22px; height: 1.6px; background: var(--forest);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.3px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.3px) rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: calc(100svh - var(--nav-h));
  max-height: calc(100svh - var(--nav-h));
  overflow-y: auto;
  padding: 0.5rem var(--gutter) 1.5rem;
  background: rgba(245, 242, 234, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__link {
  font-family: var(--font-display);
  text-decoration: none;
  color: var(--forest);
  font-size: 1.15rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.mobile-menu__cta { margin-top: 1rem; justify-content: center; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 92svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + 1.5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 18%, var(--paper-2) 0%, var(--paper) 55%);
}
.hero__contours {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero__contours svg { width: 100%; height: 100%; }

.contour {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
}
.contours-animate .contour {
  animation: draw 2.6s var(--ease) forwards;
  animation-delay: calc(var(--i) * 0.16s + 0.15s);
}
@keyframes draw {
  0%   { stroke-dashoffset: 1; opacity: 0; }
  15%  { opacity: 0.85; }
  100% { stroke-dashoffset: 0; opacity: 0.7; }
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.hero__inner > * { max-width: 47rem; }
.hero__title {
  font-size: clamp(2.6rem, 6.2vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
  max-width: 18ch;
  margin-bottom: 1.5rem;
}
.hero__lead {
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
  line-height: 1.55;
  color: var(--ink);
  max-width: 42ch;
  margin-bottom: 2.25rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* ---------- tagline band ---------- */
.band {
  background: var(--forest);
  color: var(--paper);
}
.band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3vw, 2rem);
  padding-block: clamp(1.75rem, 3.5vw, 2.75rem);
  text-align: center;
}
.band__item {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.band__sep { color: var(--sage); display: inline-flex; }

/* ---------- about ---------- */
.about { background: var(--paper); }
.about__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--sand);
  box-shadow: 12px 12px 0 var(--sand);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.about__body > * + * { margin-top: 1.1rem; }
.about__body .section__title { margin-bottom: 0.4rem; }

.about__facts {
  list-style: none;
  padding: 0;
  margin-top: 1.75rem;
  border-top: 1px solid var(--line);
}
.about__facts li {
  display: grid;
  grid-template-columns: minmax(8rem, 0.4fr) 1fr;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.about__facts-label {
  font-family: var(--font-display);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--patina-deep);
  padding-top: 0.15rem;
}
.about__facts-value { color: var(--ink); }
.about__note {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--muted);
  font-size: 0.98rem;
}

/* ---------- cards / services ---------- */
.services { background: var(--paper-2); }
.cards { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.services .cards--3 { grid-template-columns: 1fr; gap: 0; }

.card {
  display: grid;
  grid-template-columns: 3rem minmax(12rem, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 2.5vw, 2.25rem) 0;
  border-top: 1px solid var(--line);
}
.card:last-child { border-bottom: 1px solid var(--line); }
.card__glyph {
  display: inline-flex;
  color: var(--patina);
  margin: 0;
}
.card__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}
.card__text { color: var(--muted); }

/* ---------- projects / focus ---------- */
.projects { background: var(--paper); }
.projects__grid { grid-template-columns: repeat(12, 1fr); }
.focus {
  position: relative;
  background: var(--sand);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 2.4vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  grid-column: span 3;
}
.focus__title {
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.focus__text { color: var(--muted-sand); font-size: 1rem; flex: 1; }
.focus--featured {
  grid-column: span 7;
  min-height: 17rem;
  background: var(--forest);
  color: var(--paper);
}
.focus--featured + .focus { grid-column: span 5; }
.focus--featured .focus__title { color: var(--paper); font-size: clamp(1.5rem, 2.4vw, 2rem); }
.focus--featured .focus__text { color: rgba(245, 242, 234, 0.78); max-width: 52ch; }
.focus__tag {
  align-self: flex-start;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--patina-deep);
}
.focus--featured .focus__tag { color: var(--sage); }
.focus__link {
  align-self: flex-start;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--patina-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s var(--ease);
}
.focus__link:hover { border-bottom-color: var(--patina); }
.focus--featured .focus__link {
  color: var(--paper);
  border-bottom-color: rgba(245, 242, 234, 0.35);
}
.focus--featured .focus__link:hover { border-bottom-color: var(--sage); }

/* ---------- contact ---------- */
.contact { background: var(--paper-2); }
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
.contact__intro .section__title { max-width: 14ch; }
.contact__details {
  list-style: none;
  padding: 0;
  margin-top: 2.25rem;
  display: grid;
  gap: 1.25rem;
}
.contact__details li { display: flex; flex-direction: column; gap: 0.25rem; }
.contact__label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--patina-deep);
}
.contact__value {
  font-size: 1.15rem;
  color: var(--forest);
  text-decoration: none;
  width: fit-content;
}
a.contact__value { border-bottom: 1px solid var(--line); transition: border-color 0.2s var(--ease); }
a.contact__value:hover { border-bottom-color: var(--patina); }

/* ---------- form ---------- */
.form { display: grid; gap: 1.35rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--forest);
}
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--patina);
  box-shadow: 0 0 0 3px rgba(78, 124, 100, 0.16);
}
.field.is-invalid input,
.field.is-invalid textarea { border-color: var(--error); }
.field__error {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--error);
  min-height: 0.9rem;
}
.form__submit { justify-self: start; margin-top: 0.25rem; }
.form__status {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--patina-deep);
  min-height: 1.2rem;
}
.form__status.is-error { color: var(--error); }

/* ---------- footer ---------- */
.footer { background: var(--forest-2); color: var(--paper); }
.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-block: clamp(3rem, 5vw, 4.5rem);
}
.footer__tagline { color: rgba(245, 242, 234, 0.7); margin-top: 0.9rem; max-width: 30ch; }
.footer__nav { display: flex; flex-direction: column; gap: 0.7rem; }
.footer__nav a,
.footer__contact a,
.footer__contact span {
  color: rgba(245, 242, 234, 0.82);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  width: fit-content;
}
.footer__nav a:hover, .footer__contact a:hover { color: var(--sage); }
.footer__contact { display: flex; flex-direction: column; gap: 0.7rem; }

.footer__base {
  border-top: 1px solid rgba(245, 242, 234, 0.12);
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: rgba(245, 242, 234, 0.6);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .cards--3 { grid-template-columns: repeat(2, 1fr); }
  .services .cards--3 { grid-template-columns: 1fr; }
  .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .projects__grid .focus { grid-column: auto; }
  .projects__grid .focus--featured { grid-column: span 2; }
  .about__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 360px; margin-inline: auto; }
  .contact__grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  :root { --nav-h: 72px; }
  .cards--3 { grid-template-columns: 1fr; }
  .card { grid-template-columns: 2.5rem 1fr; gap: 0.65rem 1rem; }
  .card__text { grid-column: 2; }
  .projects__grid .focus--featured { grid-column: auto; min-height: 0; }
  .wordmark__img { width: 52px; height: 52px; }
  .hero { min-height: 88svh; }
  .hero__contours { opacity: 0.55; }
  .band__inner { flex-direction: column; gap: 0.75rem; }
  .band__sep { transform: rotate(90deg); }
  .footer__inner { grid-template-columns: 1fr; gap: 2.25rem; }
  .about__facts li { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .contour { opacity: 0.6; stroke-dashoffset: 0; }
  .btn:hover { transform: none; }
}
