/* ============================================================
   KuilenTech — site styles
   Two style directions via [data-direction="a"|"b"] on <html>.
   A = Light / Editorial paper.  B = Dark / Terminal.
   ============================================================ */

:root {
  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
  --r: 14px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---- Direction A · Light / Editorial ---- */
html[data-direction="a"] {
  --bg: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #111110;
  --ink-soft: #46443f;
  --muted: #817d74;
  --line: #e2ded3;
  --line-strong: #cfcabb;
  --accent: #111110;          /* mono — accent is ink */
  --on-accent: #f4f2ec;
  --chip: #ffffff;
  --ok: #15803d;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -28px rgba(0,0,0,.30);
  --grid-line: rgba(17,17,16,.05);
}

/* ---- Direction B · Dark / Terminal ---- */
html[data-direction="b"] {
  --bg: #09090b;
  --surface: #141417;
  --surface-2: #0f0f12;
  --ink: #ededed;
  --ink-soft: #c5c5c9;
  --muted: #86868f;
  --line: #232327;
  --line-strong: #34343a;
  --accent: #ededed;          /* light accent on dark */
  --on-accent: #09090b;
  --chip: #161619;
  --ok: #4ade80;
  --shadow: 0 24px 60px -34px rgba(0,0,0,.8);
  --grid-line: rgba(255,255,255,.04);
}

* { box-sizing: border-box; }

/* Disable transitions during a theme swap so var() changes repaint instantly
   (avoids the Chromium custom-property transition-stick bug). */
html.kt-swapping,
html.kt-swapping *,
html.kt-swapping *::before,
html.kt-swapping *::after {
  transition: none !important;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .4s var(--ease), color .4s var(--ease);
  overflow-x: hidden;
}

a { color: inherit; }

::selection { background: var(--ink); color: var(--bg); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Logo mark ---------- */
.mark { display: block; color: var(--ink); }
.mark svg { display: block; width: 100%; height: 100%; }

/* ---------- Mono kicker / labels ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: .6em;
}
.kicker::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--line-strong);
  display: inline-block;
}
.kicker.nodash::before { display: none; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 70px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
.brand .mark { width: 30px; height: 26px; }
.brand__name {
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.brand__name span { font-weight: 400; opacity: .85; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
}
.nav__links a {
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .02em;
  text-decoration: none;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
  transition: color .2s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1.5px; background: var(--ink);
  transition: width .25s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { width: 100%; }

.nav__tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* segmented toggle (lang + style) */
.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface);
  gap: 2px;
}
.seg button {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s var(--ease);
  line-height: 1;
}
.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }

/* primary button */
.btn {
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .02em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.btn--solid { background-color: var(--accent); color: var(--on-accent); }
.btn--solid:hover { transform: translateY(-2px); }
.btn--ghost { background-color: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translate(3px,-3px); }

.nav__cta { }

/* mobile menu button */
.nav__burger { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: clamp(56px, 11vh, 120px) 0 clamp(48px, 9vh, 96px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before {
  /* faint grid */
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 80% 0%, #000 30%, transparent 78%);
  pointer-events: none;
}
.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.45fr .95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero__title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 700;
  margin: 22px 0 0;
  text-wrap: balance;
}
.hero__title em {
  font-style: normal;
  /* outline accent word */
  -webkit-text-stroke: 1.4px var(--ink);
  color: transparent;
}
.hero__sub {
  margin: 26px 0 0;
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 46ch;
  line-height: 1.62;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

/* status card */
.statuscard {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.statuscard__mark {
  position: absolute;
  right: -26px; bottom: -34px;
  width: 190px; height: 160px;
  color: var(--ink);
  opacity: .05;
  pointer-events: none;
}
.statuscard__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
  animation: pulse 2.4s infinite var(--ease);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.status__avail { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: .8rem; color: var(--ink); }
.statuscard dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
}
.statuscard dt {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.statuscard dd {
  margin: 0;
  text-align: right;
  font-size: .95rem;
  font-weight: 500;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

/* ============================================================
   SECTION SCAFFOLD
   ============================================================ */
.section { padding: clamp(64px, 11vh, 130px) 0; border-bottom: 1px solid var(--line); }
.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: clamp(34px, 6vh, 64px);
}
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 700;
  margin: 14px 0 0;
  max-width: 18ch;
  text-wrap: balance;
}
.section__intro { color: var(--ink-soft); max-width: 40ch; font-size: 1.05rem; }

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.svc {
  position: relative;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 30px 30px 34px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: border-color .25s var(--ease), transform .25s var(--ease), background-color .25s var(--ease);
}
.svc:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.svc__num {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .1em;
}
.svc__title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 16px 0 10px;
}
.svc__desc { color: var(--ink-soft); font-size: 1rem; margin: 0; line-height: 1.55; }
.svc__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.svc__tags span {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}
.svc__arrow {
  position: absolute; top: 28px; right: 28px;
  color: var(--muted);
  transition: transform .25s var(--ease), color .25s var(--ease);
}
.svc:hover .svc__arrow { transform: translate(3px,-3px); color: var(--ink); }

/* ============================================================
   TECH STACK
   ============================================================ */
.tech {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
}
.tech__cat {
  padding: 28px 26px 30px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.tech__cat h3 {
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  font-weight: 500;
}
.tech__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tech__chips span {
  font-size: .92rem;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--chip);
  border-radius: 8px;
  padding: 7px 12px;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.tech__chips span:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ============================================================
   REFERENCES
   ============================================================ */
.refs__logos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}
.reflogo {
  aspect-ratio: 16 / 7;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}
.refs__quote {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 34px;
}
.refs__quote p {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.5;
  letter-spacing: -.01em;
  max-width: 52ch;
}
.refs__quote .kicker { margin-top: 16px; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { text-align: left; }
.contact__big {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 700;
  margin: 18px 0 0;
  max-width: 16ch;
  text-wrap: balance;
}
.contact__row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}
.contact__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1px;
  margin-top: 56px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.contact__meta > div { background: var(--bg); padding: 22px 24px; }
.contact__meta dt {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.contact__meta dd { margin: 0; font-weight: 500; font-size: 1rem; }
.contact__meta a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.contact__meta a:hover { border-color: var(--ink); }

/* ============================================================
   ABOUT
   ============================================================ */
.about__top {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
  margin-bottom: 18px;
}
.about__photo {
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow);
}
.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  filter: grayscale(1) contrast(1.04);
  transition: filter .55s var(--ease), transform .55s var(--ease);
}
.about__photo:hover img { filter: grayscale(0) contrast(1); transform: scale(1.02); }
.about__lead {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
  line-height: 1.5;
  letter-spacing: -.015em;
  color: var(--ink);
  text-wrap: pretty;
}
.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
}
.stat__num {
  display: block;
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
}
.stat__label {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--muted);
  line-height: 1.4;
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.exp {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.exp__row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 26px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .25s var(--ease);
}
.exp__row:hover { padding-left: 14px; }
.exp__org {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.exp__sub { color: var(--muted); font-weight: 400; font-size: 1rem; }
.exp__role { color: var(--ink-soft); font-size: 1.02rem; }
.exp__seclead { display: block; margin-bottom: 12px; }
.exp__sectors { display: flex; flex-wrap: wrap; gap: 8px; }
.exp__sectors span {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 11px;
}
.exp__note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
  max-width: 48ch;
}
.exp__when { justify-self: end; }
.tag-now {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.exp__rec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px 30px;
}
.exp__rec p { margin: 0; font-size: 1.1rem; color: var(--ink-soft); max-width: 52ch; }

/* ============================================================
   FOOTER
   ============================================================ */
.foot { padding: 46px 0; }
.foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.foot .brand .mark { width: 26px; height: 22px; }
.foot__meta { font-family: var(--font-mono); font-size: .76rem; color: var(--muted); letter-spacing: .03em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .nav__links { display: none; }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .statuscard { max-width: 460px; }
  .tech { grid-template-columns: repeat(2, 1fr); }
  .refs__logos { grid-template-columns: repeat(3, 1fr); }
  .about__top { grid-template-columns: 0.85fr 1.15fr; }
  .contact__meta { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .section__head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .services { grid-template-columns: 1fr; }
  .tech { grid-template-columns: 1fr; }
  .tech__cat { border-right: 0; }
  .refs__logos { grid-template-columns: repeat(2, 1fr); }
  .refs__quote { grid-template-columns: 1fr; text-align: left; }
  .contact__meta { grid-template-columns: 1fr; }
  .about__stats { display: grid; grid-template-columns: 1fr; }
  .about__top { grid-template-columns: 1fr; }
  .about__photo { max-width: 320px; aspect-ratio: 4 / 5; }
  .exp__row { grid-template-columns: 1fr; gap: 8px; }
  .exp__when { justify-self: start; }
}
@media (max-width: 420px) {
  .nav__inner { gap: 12px; }
  .seg button { padding: 5px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
}
