/* carlfeilner.com — single stylesheet, no framework */

@font-face {
  font-family: "Open Sans";
  src: url("../fonts/open-sans-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #141414;          /* dark sections */
  --navy: #0e1b41;         /* Ditto brand */
  --paper: #ffffff;
  --soft: #f6f6f8;
  --text: #141414;
  --muted: #4d4d55;        /* 8.1:1 on white */
  --blue: #0505ff;         /* brand blue, 8.6:1 on white */
  --blue-on-dark: #8a92ff; /* 6.8:1 on --ink (brand blue fails at 2.2:1) */
  --on-dark: #ffffff;
  --on-dark-muted: #c4c4cc;/* 10:1 on --ink */
  --line: #e3e3e8;
  --line-dark: #2c2c30;
  --focus: #ffbf47;        /* high-visibility focus ring, works on light and dark */
  --radius: 12px;
  --max: 1440px;
  --gutter: clamp(16px, 5vw, 48px);
  --header-h: 64px;
  font-synthesis: none;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.0625rem/1.65 "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--blue);   /* 8.6:1 on light backgrounds */
  outline-offset: 3px;
  border-radius: 4px;
}
.dark :focus-visible, .site-footer :focus-visible, .cs-hero :focus-visible, .cs-intro :focus-visible, .skip-link:focus-visible {
  outline-color: var(--focus);      /* 11:1 on dark backgrounds */
}

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

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

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--header-h); gap: 16px;
}
.brand {
  font-size: 1.375rem; font-weight: 300; letter-spacing: 0.01em;
  color: var(--text); text-decoration: none; white-space: nowrap;
  padding: 8px 0;
}
.nav-list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-list a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  color: var(--text); text-decoration: none; font-size: 0.9375rem; font-weight: 500; border-radius: 8px;
}
.nav-list a:hover { background: var(--soft); color: var(--blue); }
.nav-list a[aria-current="page"] { color: var(--blue); }
.nav-toggle {
  display: none; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--text); font: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 600px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px; display: none;
  }
  .js .site-nav.is-open { display: block; }
  .js .nav-list { flex-direction: column; }
  .js .nav-list a { width: 100%; font-size: 1.0625rem; }
  html:not(.js) .nav-list a { padding: 0 8px; font-size: 0.875rem; }
  html:not(.js) .brand { font-size: 1.125rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; border: 2px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0000c8; }
.btn-ghost { border-color: currentColor; color: var(--on-dark); }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn small { font-weight: 400; opacity: 0.85; font-size: 0.8125rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero {
  /* Fills ~90% of the screen below the header, so just a sliver of the next section shows */
  display: grid; align-items: center;
  min-height: calc(90vh - var(--header-h));
  min-height: calc(90svh - var(--header-h));
  background: var(--paper) url("../img/hero-bg.webp") center / cover no-repeat;
  padding-block: 48px;
}
.hero .wrap { display: grid; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.1fr 1fr; } }
.d-br { display: none; }
@media (min-width: 1100px) { .d-br { display: inline; } }
.hero h1 {
  font-size: clamp(2.125rem, 4.6vw, 3.5rem); font-weight: 400; line-height: 1.18; letter-spacing: -0.01em;
}
.hero h1 .hello { display: block; color: var(--blue); font-weight: 600; }
.hero .lede, .hero .lede + p { font-size: clamp(1.0625rem, 1.3vw, 1.25rem); font-weight: 300; line-height: 1.6; color: #2b2b30; }
.hero .lede { max-width: 46ch; }
@media (min-width: 1100px) { .hero .lede { max-width: none; } }
.hero .lede + p { margin-top: 16px; }
.file-meta { font-size: 0.8125em; color: var(--muted); white-space: nowrap; }

/* ---------- Work (dark) ---------- */
.dark { background: var(--ink); color: var(--on-dark); }
.dark a:not(.btn) { color: var(--blue-on-dark); }

.work { padding-block: clamp(72px, 12vw, 140px) clamp(40px, 6vw, 80px); }
.statement {
  font-size: clamp(1.75rem, 3.6vw, 2.75rem); font-weight: 400; line-height: 1.25; max-width: 22ch;
  margin-bottom: clamp(48px, 8vw, 96px);
}
.statement strong { color: var(--blue-on-dark); font-weight: 600; }

.project-list { list-style: none; margin: 0; padding: 0; }
.project {
  display: grid; gap: 28px; align-items: center;
  padding-block: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line-dark);
}
@media (min-width: 900px) { .project { grid-template-columns: minmax(260px, 0.85fr) 2.6fr; gap: clamp(32px, 4vw, 72px); } }
.project h3 { font-size: clamp(1.5rem, 2.4vw, 1.875rem); font-weight: 500; }
.project p { margin-top: 14px; color: var(--on-dark-muted); max-width: 40ch; }
.project .status {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px;
  font-size: 0.9375rem; font-weight: 600;
}
.project .status.soon { color: var(--on-dark-muted); font-weight: 500; }
.project .status.soon::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .6;
}
a.status { min-height: 44px; }

/* Videos already contain their own device frame, so no box/radius — they sit straight on the dark section */
.media { position: relative; margin: 0; aspect-ratio: 1280 / 796; }
.media video { width: 100%; height: 100%; object-fit: contain; background: transparent; }
@media (min-width: 900px) { .media { margin-right: calc(-1 * clamp(0px, 2vw, 32px)); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .media video { transition: transform .45s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
  .project:hover .media video { transform: scale(1.04); }
}

/* ---------- Showcase ---------- */
.showcase { background: linear-gradient(var(--ink) 0 50%, var(--soft) 50% 100%); }
.showcase img { width: 100%; }

/* ---------- About ---------- */
.about { background: var(--soft); padding-block: clamp(56px, 9vw, 112px); }
.about section + section { margin-top: clamp(64px, 9vw, 112px); }
.section-title { font-size: clamp(1.625rem, 2.6vw, 2.125rem); margin-bottom: 32px; }

.achievements {
  display: grid; gap: 16px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
@media (min-width: 900px) { .achievements { grid-template-columns: repeat(4, 1fr); } }
.achievements li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; font-size: 0.9875rem; line-height: 1.5;
}
.achievements svg { flex: none; width: 28px; height: 28px; color: var(--blue); }

.tools {
  display: grid; gap: 16px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr));
}
@media (min-width: 900px) { .tools { grid-template-columns: repeat(6, 1fr); } }
.tools li {
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 12px; font-size: 0.875rem; font-weight: 500;
}
@media (min-width: 900px) { .tools li { padding-block: 36px 32px; gap: 16px; } }
.tools img { width: 56px; height: 56px; object-fit: contain; }

.reviews {
  display: grid; gap: 20px; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.review {
  display: flex; flex-direction: column; gap: 20px; margin: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px;
}
.review blockquote { margin: 0; font-size: 1.0625rem; color: var(--text); flex: 1; }
.review blockquote p::before { content: "\201C"; }
.review blockquote p::after { content: "\201D"; }
.review figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 0.9375rem; padding-top: 16px; border-top: 1px solid var(--line); }
.review figcaption strong { color: var(--text); }
.review figcaption span { color: var(--muted); }
.review img { align-self: flex-start; width: auto; height: 32px; }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  background: var(--ink) url("../img/footer-bg.webp") center top / cover no-repeat;
  padding-top: clamp(72px, 11vw, 160px);
  overflow: hidden; /* crops the CV preview at the section's bottom edge */
}
/* Brand-blue bar along the bottom of the section; the CV preview sits over it */
.contact::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--blue);
}
.contact .wrap { display: grid; gap: 48px; align-items: end; }
.contact .wrap > div:first-child { padding-bottom: clamp(40px, 6vw, 64px); align-self: center; }
@media (min-width: 900px) {
  .contact .wrap { grid-template-columns: 1fr 1fr; }
  .contact .wrap > div:first-child { padding-bottom: clamp(72px, 11vw, 160px); }
}
.contact h2 { font-size: clamp(2.25rem, 4vw, 3.75rem); }
.contact h2 + p { font-size: clamp(1.5rem, 3vw, 3rem); font-weight: 300; line-height: 1.3; margin: 8px 0 40px; max-width: 20ch; }

/* CV preview: large, cropped by the section bottom, and scales up into place when scrolled to */
.cv-card {
  position: relative; z-index: 1;
  display: block; width: 100%; max-width: 680px; justify-self: end;
  height: clamp(320px, 34vw, 520px); overflow: hidden;
  border-radius: 6px 6px 0 0; box-shadow: 0 -10px 60px rgba(0, 0, 0, .45);
  transform-origin: 50% 100%;
}
.cv-card img { width: 100%; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .js .cv-card { transform: translateY(40px) scale(.86); opacity: 0; transition: transform .8s cubic-bezier(.2, .7, .2, 1), opacity .6s ease; }
  .js .cv-card.is-in { transform: none; opacity: 1; }
  /* Grows from its bottom edge, so it stays flush with the section bottom (no gap) */
  .js .cv-card.is-in:hover { transform: scale(1.03); transition-duration: .3s; }
}

/* ---------- Footer ---------- */
.site-footer { background: #0b0b0c; color: var(--on-dark-muted); font-size: 0.9375rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-block: 24px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.site-footer a, .link-button { color: var(--on-dark); }
.link-button { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.site-footer a, .site-footer .link-button { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Consent ---------- */
.consent {
  position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px;
  max-width: 440px; margin-left: auto;
  background: var(--paper); color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.25);
  padding: 20px;
}
.consent[hidden] { display: none; }
.consent h2 { font-size: 1.0625rem; margin-bottom: 6px; }
.consent p { font-size: 0.9375rem; color: var(--muted); }
.consent .btn-row { margin-top: 16px; }
.consent .btn { flex: 1; min-height: 44px; }
.btn-outline { border-color: var(--text); color: var(--text); background: transparent; }
.btn-outline:hover { background: var(--text); color: #fff; }

/* ---------- Case study (Ditto) ---------- */
.cs-hero {
  position: relative; display: grid; place-items: center; text-align: center;
  min-height: min(78vh, 720px); color: #fff; overflow: hidden; background: var(--navy);
}
.cs-hero picture, .cs-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cs-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(14,27,65,.55), rgba(14,27,65,.9)); }
.cs-hero .wrap { position: relative; z-index: 1; }
.cs-hero h1 { font-size: clamp(3rem, 9vw, 6rem); font-weight: 700; }
.cs-hero p { margin-top: 12px; font-size: 1.125rem; color: #dfe3f5; }

.cs-intro { background: var(--navy); color: #fff; padding-block: 0 clamp(56px, 8vw, 96px); }
.cs-intro .phone { width: min(260px, 60vw); margin: -120px auto 48px; position: relative; z-index: 2; }
.cs-intro .summary { font-size: clamp(1.1875rem, 2vw, 1.5rem); font-weight: 300; max-width: 52ch; margin-inline: auto; text-align: center; }
.facts {
  display: grid; gap: 24px; margin: 56px auto 0; max-width: 960px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  text-align: center;
}
.facts dt { font-size: 0.8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #aeb7e0; }
.facts dd { margin: 6px 0 0; font-size: 1.0625rem; }

.cs-body { padding-block: clamp(56px, 9vw, 112px); }
.cs-section + .cs-section { margin-top: clamp(64px, 10vw, 120px); }
.cs-section h2 { font-size: clamp(1.625rem, 2.8vw, 2.25rem); margin-bottom: 20px; }
.cs-section h2 span { color: var(--blue); margin-right: .35em; font-variant-numeric: tabular-nums; }
.prose { max-width: 68ch; }
.prose p + p { margin-top: 16px; }
.prose p, .cs-section > p { color: var(--muted); font-size: 1.0625rem; }
.cs-section .prose, .cs-section > p { margin-block: 20px; }

.gallery { display: grid; gap: 16px; margin: 32px 0; padding: 0; list-style: none; }
.gallery img { width: 100%; border-radius: 10px; background: var(--soft); }
.g-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.g-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.g-4 { grid-template-columns: repeat(auto-fit, minmax(min(45%, 200px), 1fr)); }
.gallery.phones img { background: none; }
.full-bleed { margin: 0; background: var(--ink); }
.full-bleed img { width: 100%; max-width: 1600px; margin-inline: auto; }
.cs-thanks { text-align: center; padding-block: clamp(64px, 10vw, 120px); }
.cs-thanks h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.cs-thanks p { margin: 12px auto 0; max-width: 46ch; color: var(--on-dark-muted); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 24px; font-weight: 600; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 96px; }
.notfound h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 12px; }
.notfound p { color: var(--muted); margin-bottom: 24px; }
