/* kerlvision.com — the only stylesheet. Mobile-first; 720px tablet, 1024px desktop. */

/* Fonts: self-hosted (KV-4), the files and character ranges Google Fonts served.
   Both are variable fonts, so one file per character set covers every weight.
   Licences: assets/fonts/OFL-*.txt. */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/space-grotesk-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-greek.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  --ground: #f4f5f3;
  --ink: #0f1f26;
  --accent: #0a7fa6;
  --accent-2: #17c3a8;
  --accent-text: #08769b;
  --surface: #ffffff;
  --panel: #0f1f26;
  --panel-text: #e9f4f2;
  --panel-muted: #a9c2c0;
  --panel-label: #7fb9b0;
  --panel-rule: #2b3f47;
  --text-2: #2f4047;
  --muted: #4f6068;
  --rule: #c6cdcc;
  --on-accent: #ffffff;
  --brand-ink: #0f1f26;
  --ink-2: #16262f;
  --panel-deep: #0a1419;
  --font-text: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --max: 1200px;
  --gutter: 24px;
  color-scheme: light;
}

/* Base */

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  line-height: 1.5;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  color: var(--accent-text);
}

a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

picture {
  display: block;
}

.wrap {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--ground);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.skip-link:hover {
  color: var(--ground);
}

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

/* Header and nav */

.site-header {
  border-bottom: 2px solid var(--ink);
  background: var(--ground);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-logo {
  display: block;
  width: 68px;
  height: 44px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
}

.nav-email,
.nav-email:hover {
  color: var(--accent-text);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-top: 40px;
  padding-bottom: 48px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.hero-status {
  color: var(--accent-text);
}

.hero-title {
  margin: 24px 0 0;
  font-size: clamp(44px, 11vw, 80px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero-title-accent {
  color: var(--accent);
}

.hero-lede {
  max-width: 620px;
  margin: 24px 0 0;
  font-size: 20px;
  color: var(--text-2);
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 22px;
  border: 2px solid var(--ink);
  background: var(--panel);
  color: var(--panel-text);
  font-family: var(--font-mono);
  font-size: 14px;
}

/* The label sits outside the <dl>: a <dl> may only hold dt/dd groups (KV-4). */
.stats-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--panel-label);
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-rule);
}

.stats-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.stats-row dt {
  color: var(--panel-muted);
}

.stats-row dd {
  margin: 0;
  font-weight: 700;
}

.stats-rating {
  color: var(--accent-2);
}

/* Doors: for clients / for employers */

.doors {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 56px;
}

.door {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 2px solid var(--ink);
}

.door--client {
  background: var(--surface);
}

.door--employer {
  background: var(--accent);
  color: var(--on-accent);
}

.door--employer .label {
  color: var(--on-accent);
}

.door h2 {
  margin: 0;
  font-size: clamp(24px, 6.5vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.door ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  font-size: 16px;
}

.door--client ul {
  color: var(--text-2);
}

.btn {
  align-self: flex-start;
  margin-top: auto;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 600;
}

.btn--ink,
.btn--ink:hover {
  background: var(--ink);
  color: var(--ground);
}

.btn--light,
.btn--light:hover {
  background: var(--on-accent);
  color: var(--brand-ink);
}

/* Selected work */

.work {
  border-top: 2px solid var(--ink);
}

.work-inner {
  padding-top: 40px;
  padding-bottom: 56px;
}

.work .label {
  margin-bottom: 32px;
}

.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}

.work-row:last-child {
  border-bottom: 1px solid var(--rule);
}

.work-media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: left top;
  border: 1px solid var(--rule);
}

.work-media--center img {
  object-position: center top;
}

.work-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.work-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.work-body h3 {
  margin: 0;
  font-size: clamp(22px, 6vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.work-body p {
  margin: 0;
  font-size: 16px;
  color: var(--text-2);
}

.work-tech {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.work-link,
.work-link:hover {
  align-self: flex-start;
  font-weight: 600;
  color: var(--accent-text);
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* Case-study pages: /work/<slug>/ */

.case {
  padding-top: 24px;
  padding-bottom: 56px;
}

.case-back,
.case-back:hover {
  display: inline-block;
  padding: 12px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-text);
}

.case .work-kicker {
  margin-top: 16px;
}

.case-title {
  margin: 12px 0 24px;
  font-size: clamp(32px, 9vw, 56px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.case-hero {
  margin-bottom: 40px;
}

.case-hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.case-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.case-section h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.case-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-body p {
  max-width: 66ch;
  margin: 0;
  font-size: 17px;
  color: var(--text-2);
}

.case-body .work-tech {
  font-size: 13px;
  color: var(--muted);
}

.case-visit {
  margin: 0;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}

.case-visit a,
.case-visit a:hover {
  font-weight: 600;
  color: var(--accent-text);
}

.case-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.case-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.case-pager-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

/* Long-form case studies (KV-2b): any case page can opt in with .case--long + .article.
   Prose and header sit in a 760px column; wide figures break out to 1100px. */

.case--long > *,
.article > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.case--long > .case-hero,
.article > .figure-wide,
.article > .figure-hero-pair {
  max-width: 1100px;
}

.reading-time {
  margin-top: 0;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.article {
  max-width: none;
  padding-bottom: 24px;
}

.article h2 {
  margin-top: 56px;
  margin-bottom: 12px;
  font-size: clamp(24px, 6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.article h3 {
  margin-top: 36px;
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.article p,
.article li {
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-2);
}

.article p {
  margin-top: 0;
  margin-bottom: 16px;
}

.article ul {
  margin-top: 0;
  margin-bottom: 16px;
  padding-left: 22px;
}

.article p a,
.article li a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.figure {
  margin-top: 32px;
  margin-bottom: 32px;
}

.figure figcaption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.figure-wide img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.figure-pair-images {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 16px;
}

.figure-phone {
  width: 100%;
  max-width: 342px;
}

/* Opener: a desktop screenshot beside a phone one; stacked below 1024px. */
.figure-hero-pair-images {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-items: start;
  gap: 16px;
}

.figure-hero-pair-images .figure-desktop {
  width: 100%;
}

.figure-desktop img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.figure-phone img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 24px;
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-box {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}

.diagram-band {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}

.diagram-line {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.diagram-arrow {
  fill: var(--muted);
}

.diagram-label {
  fill: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 600;
}

.diagram-note {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.diagram-band-label {
  fill: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
}

.diagram-list {
  margin-top: 16px;
}

.diagram-list li {
  font-size: 15px;
}

.article-cta {
  margin-top: 16px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.article-cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.article-cta-links .btn {
  margin-top: 0;
}

/* Testimonials */

.quotes {
  background: var(--panel);
  color: var(--panel-text);
}

.quotes-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.quote {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
}

.quote blockquote {
  margin: 0;
}

.quote p {
  margin: 0 0 12px;
}

.quote figcaption {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--panel-label);
}

/* About */

.about {
  border-top: 2px solid var(--ink);
}

.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  padding-top: 40px;
  padding-bottom: 56px;
}

.about-photo {
  max-width: 240px;
}

.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.about .label {
  margin-bottom: 12px;
}

.about h2 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.about-bio {
  margin: 0 0 12px;
  font-size: 17px;
  color: var(--text-2);
}

.about-langs {
  margin: 0 0 20px;
  font-size: 15px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.chip {
  padding: 10px 16px;
  border: 1px solid var(--ink);
}

.chip--ink,
.chip--ink:hover {
  background: var(--ink);
  color: var(--ground);
  font-weight: 500;
}

/* Footer */

.site-footer {
  border-top: 2px solid var(--ink);
  background: var(--surface);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 32px;
  padding-top: 40px;
  padding-bottom: 40px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.footer-logo {
  display: block;
  width: 76px;
  height: 48px;
  object-fit: contain;
}

.footer-email,
.footer-email:hover {
  font-family: var(--font-text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.footer-spacer {
  flex: 1 1 200px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
}

.footer-legal {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
}

/* Tablet */

@media (min-width: 720px) {
  .door {
    padding: 32px;
  }

  .doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 72px;
  }

  .work-row {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 32px;
  }

  .work-media {
    grid-column: span 4;
  }

  .work-body {
    grid-column: span 8;
  }

  .about-inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .about-photo {
    grid-column: span 3;
    max-width: none;
  }

  .about-body {
    grid-column: span 9;
  }

  .footer-email,
  .footer-email:hover {
    font-size: 28px;
  }

  .case-pager {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-pager-link--next {
    align-items: flex-end;
    text-align: right;
  }

  .figure-pair-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}

/* Desktop: the reference layout */

@media (min-width: 1024px) {
  .nav-links {
    gap: 12px 28px;
    margin-left: auto;
  }

  .hero {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    padding-top: 72px;
    padding-bottom: 56px;
  }

  .hero-meta {
    grid-column: span 12;
  }

  .hero-main {
    grid-column: span 8;
  }

  .stats {
    grid-column: span 4;
  }

  .work-inner {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .quotes-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .about-inner {
    padding-top: 56px;
    padding-bottom: 72px;
  }

  .figure-hero-pair-images {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: 24px;
  }

  .case {
    padding-top: 40px;
    padding-bottom: 72px;
  }

  .case-section {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 32px;
  }

  .case-section h2 {
    grid-column: span 4;
  }

  .case-body {
    grid-column: span 8;
  }
}

/* 404 page */

.not-found {
  padding-top: 40px;
  padding-bottom: 72px;
}

.not-found .hero-lede {
  margin-bottom: 24px;
}

.not-found-list {
  margin: 32px 0 0;
  padding-left: 20px;
  font-size: 17px;
}

.not-found-list li + li {
  margin-top: 8px;
}

.not-found-list a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
