/* =====================================================================
   Nils Goldbeck — Fractional CTO & AI Solutions Architect
   Corporate design system. See /brand for rationale.
   ===================================================================== */

/* ----- Fonts (self-hosted, latin subset, variable) ------------------ */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ----- Design tokens ------------------------------------------------ */
:root {
  /* Brand palette */
  --ink:          #0F1B2D;  /* deep navy — primary text & dark sections */
  --ink-2:        #16243a;  /* dark surface, slightly lifted */
  --ink-3:        #20324c;  /* dark hairline / lifted card on dark */
  --slate:        #4f5d76;  /* secondary text on light */
  --slate-2:      #6c7990;  /* muted text */
  --canvas:       #fbfaf7;  /* warm off-white page background */
  --surface:      #ffffff;  /* cards on light */
  --line:         #e8e3d8;  /* hairline on light */
  --accent:       #b86a1e;  /* copper — buttons & accents on light */
  --accent-strong:#9a571a;  /* copper hover / links on light (AA) */
  --accent-soft:  #e6a94e;  /* warm gold — decorative / on dark */
  --accent-tint:  #f5ecdd;  /* subtle copper wash */

  /* Type */
  --font-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI',
               Roboto, Helvetica, Arial, sans-serif;

  /* Rhythm */
  --container: 1120px;
  --measure: 64ch;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .04), 0 2px 8px rgba(15, 27, 45, .05);
  --shadow-md: 0 8px 30px rgba(15, 27, 45, .08);
  --shadow-lg: 0 24px 60px rgba(15, 27, 45, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ----- Reset / base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .25vw, 1.075rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08;
  letter-spacing: -.02em; color: var(--ink); margin: 0; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* ----- Layout helpers ----------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem); }
.section { padding-block: clamp(4rem, 8vw, 7rem); }
.eyebrow {
  font-family: var(--font-display); font-weight: 600; font-size: .8rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent-strong);
  margin: 0 0 1rem;
}
.eyebrow--dark { color: var(--accent-soft); }
.section__head { max-width: 56ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head h2 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); }
.section__head p { color: var(--slate); margin-top: 1rem; font-size: 1.08em; }
.lead { color: var(--slate); font-size: 1.15em; max-width: var(--measure); }

/* ----- Buttons ------------------------------------------------------ */
.btn {
  --btn-bg: var(--accent); --btn-fg: #fff; --btn-bd: var(--accent);
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-display); font-weight: 600; font-size: .98rem;
  line-height: 1; letter-spacing: -.01em;
  padding: .92em 1.4em; border-radius: 999px; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd);
  transition: transform .18s var(--ease), background .18s var(--ease),
              box-shadow .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md);
  background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn .ico { width: 1.05em; height: 1.05em; }
.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line);
  box-shadow: none;
}
.btn--ghost:hover { background: var(--surface); color: var(--ink);
  border-color: var(--slate-2); box-shadow: var(--shadow-sm); }
.btn--on-dark { --btn-bg: var(--accent-soft); --btn-fg: var(--ink); --btn-bd: var(--accent-soft); }
.btn--on-dark:hover { background: #f0bd6c; border-color: #f0bd6c; color: var(--ink); }
.btn--ghost-dark { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.28); box-shadow: none; }
.btn--ghost-dark:hover { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.5); }

/* ----- Header ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, .82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 32px; height: 32px; flex: none; border-radius: 8px; box-shadow: var(--shadow-sm); }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem;
  letter-spacing: -.01em; }
.brand__name span { color: var(--slate-2); font-weight: 500; }
.nav { display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.9rem); }
.nav__link { font-family: var(--font-display); font-weight: 500; font-size: .95rem;
  color: var(--slate); }
.nav__link:hover { color: var(--ink); }
.nav__cta { margin-left: .4rem; }
@media (max-width: 820px) {
  .nav__link { display: none; }
}

/* ----- Hero --------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center; }
.hero__title { font-size: clamp(2.4rem, 1.4rem + 4.4vw, 4.1rem); letter-spacing: -.035em;
  margin-top: .4rem; }
.hero__title .accent { color: var(--accent); }
.hero__lead { margin-top: 1.4rem; }
.hero__lead strong { color: var(--ink); font-weight: 600; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* Headshot card */
.portrait { position: relative; justify-self: center; width: min(360px, 100%); }
.portrait__frame { position: relative; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--surface); }
.portrait__frame img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.portrait__badge {
  position: absolute; left: -14px; bottom: 18px; z-index: 2;
  display: flex; align-items: center; gap: .55rem;
  background: var(--ink); color: #fff; padding: .6rem .9rem; border-radius: 12px;
  box-shadow: var(--shadow-md); font-family: var(--font-display); font-size: .82rem;
}
.portrait__badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84;
  box-shadow: 0 0 0 3px rgba(61,220,132,.18); flex: none; }
.portrait::after { /* decorative graph corner */
  content: ""; position: absolute; right: -22px; top: -22px; width: 120px; height: 120px;
  z-index: -1; border-radius: 16px;
  background:
    radial-gradient(circle, rgba(184,106,30,.5) 1.4px, transparent 1.6px) 0 0 / 18px 18px;
  opacity: .5;
}

/* dotted graph backdrop for hero */
.hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 78% -10%, rgba(184,106,30,.06), transparent 60%),
    radial-gradient(circle, rgba(15,27,45,.05) 1px, transparent 1.4px) 0 0 / 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
}

/* ----- Proof strip -------------------------------------------------- */
.proof { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--surface), var(--surface)); }
.proof__inner { display: flex; flex-wrap: wrap; align-items: center;
  gap: clamp(1rem, 3vw, 2.4rem); padding-block: 1.1rem; }
.proof__label { font-family: var(--font-display); font-size: .74rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--slate-2); }
.proof__item { display: inline-flex; align-items: baseline; gap: .45rem;
  font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: .98rem; }
.proof__item span { color: var(--slate); font-weight: 400; font-family: var(--font-body);
  font-size: .92rem; }

/* ----- Reference logos (greyscale marquee) -------------------------- */
.about__aside { display: flex; flex-direction: column; gap: clamp(1.5rem, 3vw, 2rem); min-width: 0;
  align-self: stretch; }
.about__logos { border-top: 1px solid var(--line); padding-top: clamp(1.4rem, 3vw, 1.9rem); min-width: 0;
  flex: 1; display: flex; flex-direction: column; }
.logos__caption { text-align: center; font-family: var(--font-display); font-weight: 500;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--slate-2);
  margin-bottom: 1.2rem; }
.logos__grid { flex: 1; display: grid; gap: clamp(.6rem, 1.5vw, 1rem); margin: 0; padding: 0;
  list-style: none; grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(72px, 1fr); }
.logos__tile { display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; padding: clamp(.9rem, 2.5vw, 1.4rem);
  transition: border-color .25s var(--ease), background-color .25s var(--ease); }
.logos__tile:hover { border-color: var(--slate-2); background-color: rgba(0, 0, 0, .02); }
.logos__tile img { max-height: 34px; max-width: 100%; width: auto; display: block;
  filter: grayscale(1); opacity: .55;
  transition: filter .25s var(--ease), opacity .35s var(--ease); }
.logos__tile:hover img { filter: grayscale(0); opacity: 1; }
.logos__tile img.is-out { opacity: 0; }
@media (max-width: 560px) {
  .logos__grid { grid-auto-rows: minmax(64px, auto); }
}

/* ----- Services ----------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem 1.6rem 1.8rem;
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease),
  border-color .2s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #ddd5c6; }
.card__icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent-strong); margin-bottom: 1.1rem; }
.card__icon svg { width: 24px; height: 24px; }
.card h3 { font-size: 1.22rem; margin-bottom: .55rem; }
.card p { color: var(--slate); font-size: .98rem; }
.card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; }
.tag { font-family: var(--font-display); font-size: .76rem; font-weight: 500; color: var(--slate);
  background: var(--canvas); border: 1px solid var(--line); border-radius: 999px;
  padding: .28rem .65rem; }

/* ----- Approach ----------------------------------------------------- */
.approach { background: var(--surface); border-block: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2.2rem);
  counter-reset: step; }
.step { position: relative; padding-top: 1.5rem; border-top: 2px solid var(--ink); }
.step__num { font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  color: var(--accent-strong); letter-spacing: .04em; }
.step h3 { font-size: 1.25rem; margin: .35rem 0 .5rem; }
.step p { color: var(--slate); font-size: .98rem; }
.formats { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.formats__label { width: 100%; font-family: var(--font-display); font-size: .78rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--slate-2); margin-bottom: .2rem; }
.pill { font-family: var(--font-display); font-weight: 500; font-size: .9rem; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem 1rem; }
.pill b { color: var(--accent-strong); font-weight: 600; }

/* ----- About + metrics ---------------------------------------------- */
.about__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about__body p + p { margin-top: 1rem; }
.about__body .lead { margin-bottom: 1.2rem; }
.signature { font-family: var(--font-display); color: var(--slate-2); font-size: .92rem;
  margin-top: 1.6rem; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric { background: var(--surface); padding: 1.5rem 1.4rem; }
.metric__num { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.2rem);
  letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.metric__num span { color: var(--accent); }
.metric__label { color: var(--slate); font-size: .92rem; margin-top: .45rem; }

/* ----- Contact (dark band) ------------------------------------------ */
.contact { background: var(--ink); color: #eaf0f7; position: relative; overflow: hidden; }
.contact__bg { position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(50rem 30rem at 12% 0%, rgba(230,169,78,.12), transparent 60%),
    radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1.4px) 0 0 / 28px 28px;
  -webkit-mask-image: radial-gradient(60% 100% at 30% 0%, #000, transparent 75%);
  mask-image: radial-gradient(60% 100% at 30% 0%, #000, transparent 75%);
}
.contact__inner { position: relative; z-index: 1; display: grid;
  grid-template-columns: 1.3fr .7fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.contact h2 { color: #fff; font-size: clamp(2rem, 1.3rem + 2.6vw, 3rem); }
.contact p { color: #aebbcd; margin-top: 1rem; max-width: 46ch; }
.contact__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.contact__avail { display: inline-flex; align-items: center; gap: .55rem; margin-top: 1.6rem;
  font-size: .92rem; color: #aebbcd; }
.contact__avail .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #3ddc84;
  box-shadow: 0 0 0 3px rgba(61,220,132,.16); }
.contact__card { background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--radius);
  padding: 1.5rem; }
.contact__card h3 { color: #fff; font-size: 1.05rem; margin-bottom: 1rem; }
.social { display: grid; gap: .35rem; }
.social a { display: flex; align-items: center; gap: .8rem; color: #cdd7e4;
  padding: .6rem .7rem; border-radius: 10px; font-size: .95rem; transition: background .15s var(--ease); }
.social a:hover { background: rgba(255,255,255,.05); color: #fff; }
.social svg { width: 20px; height: 20px; flex: none; color: var(--accent-soft); }
.contact__form { display: grid; gap: 1.1rem; margin-top: 2rem; max-width: 34rem; }
.contact__form .field { display: grid; gap: .45rem; }
.contact__form label { font-family: var(--font-display); font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: #9fb0c4; }
.contact__form input, .contact__form textarea { width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,.04); border: 1px solid var(--ink-3); border-radius: 12px;
  color: #eaf0f7; font: inherit; font-size: 1rem; padding: .85rem 1rem;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease); }
.contact__form input::placeholder, .contact__form textarea::placeholder { color: #6b7a8d; }
.contact__form input:hover, .contact__form textarea:hover { border-color: #33486a; }
.contact__form textarea { resize: vertical; min-height: 8rem; line-height: 1.5; }
.contact__form input:focus, .contact__form textarea:focus { outline: none;
  background: rgba(255,255,255,.06); border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(230,169,78,.2); }
.contact__form button { justify-self: start; margin-top: .4rem; }
.contact__hp { position: absolute; left: -9999px; }

/* ----- Footer ------------------------------------------------------- */
.site-footer { background: var(--ink); color: #8d9bb0; border-top: 1px solid var(--ink-3); }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1rem; padding-block: 1.6rem; }
.site-footer a { color: #aebbcd; }
.site-footer a:hover { color: #fff; }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .9rem; }
.site-footer__brand { display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-display); color: #cdd7e4; font-size: .95rem; }
.site-footer__brand img { width: 26px; height: 26px; }

/* ----- Responsive --------------------------------------------------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(300px, 80%); }
  .cards { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .about__grid { grid-template-columns: 1fr; }
  .contact__inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .proof__label { width: 100%; }
}

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; color: #fff; }
