/* Fikromatik — site styles
   Brand: Ink #0E1426 · Ultramarine #2E3FD8 · Blue on dark #6F7DFF · Light ground #F5F6FA
   Type: Geist (self-hosted, SIL OFL 1.1) */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0E1426;
  --blue: #2E3FD8;
  --blue-dark: #6F7DFF;
  --ground: #F5F6FA;
  --white: #FFFFFF;
  --muted: #4A5169;          /* 7.3:1 on --ground */
  --muted-dark: #B9BDD0;     /* 10:1 on --ink */
  --line: rgba(14, 20, 38, 0.12);
  --line-strong: rgba(14, 20, 38, 0.22);
  --line-dark: rgba(255, 255, 255, 0.16);
  --error: #B42318;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --track-display: -0.035em;
  --track-head: -0.025em;

  --gutter: clamp(20px, 5vw, 48px);
  --max: 1200px;
  --header-h: 72px;
  --section-y: clamp(80px, 11vw, 152px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;      /* 17px */
  line-height: 1.6;
  font-feature-settings: "ss01" 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  padding-top: var(--header-h);   /* room for the fixed header */
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
::selection { background: var(--blue); color: var(--white); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  text-decoration: none;
  font-weight: 500;
}
.skip:focus { top: 12px; }

section[id] { scroll-margin-top: var(--header-h); }

/* ---------- Type ---------- */

.display {
  font-size: clamp(2.75rem, 1.2rem + 4.6vw, 5.25rem);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

.statement {
  font-size: clamp(2.6rem, 1rem + 6.6vw, 6.5rem);
  line-height: 0.96;
  font-weight: 600;
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

.h2 {
  font-size: clamp(1.875rem, 1.2rem + 2.2vw, 2.75rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: var(--track-head);
  text-wrap: balance;
}

h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead {
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.5;
  color: var(--muted);
  max-width: 34em;
  text-wrap: pretty;
}

p { text-wrap: pretty; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--blue); }
.btn-primary[disabled] { background: var(--muted); cursor: progress; }
.btn-quiet { color: var(--ink); border-color: var(--line-strong); }
.btn-quiet:hover { border-color: var(--ink); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--ground);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand { display: block; padding: 6px 0; }
.brand img { width: 180px; height: auto; }

.site-nav ul { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: block;
  padding: 10px 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.nav-contact {
  margin-left: 10px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 9px 16px;
}
.site-nav a.nav-contact:hover { border-color: var(--ink); }

.menu-toggle { display: none; }

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .brand img { width: 150px; }

  .js .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 4px 0 12px;
    margin-right: -4px;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
  }
  .menu-toggle-icon { position: relative; width: 18px; height: 12px; }
  .menu-toggle-icon span {
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
    transition: transform 0.25s var(--ease), top 0.25s var(--ease);
  }
  .menu-toggle-icon span:first-child { top: 2px; }
  .menu-toggle-icon span:last-child { top: 8px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:first-child { top: 5px; transform: rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon span:last-child { top: 5px; transform: rotate(-45deg); }

  .js .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--ground);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px;
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav a {
    padding: 14px 0;
    font-size: 1.25rem;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  .js .site-nav a.nav-contact {
    margin: 20px 0 0;
    border: 0;
    border-radius: 2px;
    background: var(--ink);
    color: var(--white);
    text-align: center;
    padding: 14px 0;
    font-size: 1rem;
  }

  /* Without JavaScript the links simply sit in a row under the logo */
  .no-js body { padding-top: 0; }
  .no-js .site-header { position: relative; }
  .no-js .header-inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 8px; }
  .no-js .site-nav a { padding: 8px 10px 8px 0; }
  .no-js .site-nav a.nav-contact { margin-left: 0; border: 0; padding: 8px 0; }
}

/* ---------- Hero ---------- */

.hero { padding: clamp(32px, 5vw, 72px) 0 clamp(72px, 9vw, 120px); }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  min-height: min(calc(100svh - var(--header-h) - 160px), 500px);
}

.hero-copy .lead { margin-top: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.hero-visual { position: relative; }

.field {
  width: 100%;
  height: auto;
  aspect-ratio: 512 / 352;
  overflow: visible;
}
.field rect {
  fill: var(--ink);
  transition: fill 0.5s var(--ease), fill-opacity 0.5s var(--ease);
}
.field .r2 { fill-opacity: 0.075; }
.field .r3 { fill-opacity: 0.055; }
.field .r4 { fill-opacity: 0.04; }
.field .r5 { fill-opacity: 0.026; }
.field .r6 { fill-opacity: 0.016; }

@media (hover: hover) and (pointer: fine) {
  .field rect:hover {
    fill: var(--blue);
    fill-opacity: 0.22;
    transition-duration: 0.08s;
  }
}

/* One orchestrated moment: the field settles outward from the symbol */
@media (prefers-reduced-motion: no-preference) {
  .field rect,
  .field image { animation: cell-in 0.9s var(--ease) both; }
  .field image { animation-name: symbol-in; animation-duration: 0.7s; }
  .field .r2 { animation-delay: 0.25s; }
  .field .r3 { animation-delay: 0.38s; }
  .field .r4 { animation-delay: 0.51s; }
  .field .r5 { animation-delay: 0.64s; }
  .field .r6 { animation-delay: 0.77s; }
}
@keyframes cell-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes symbol-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; min-height: 0; gap: 56px; }
  .hero-visual { order: 2; margin: 0 calc(var(--gutter) * -1); }
  .field { aspect-ratio: auto; height: clamp(220px, 58vw, 360px); }
}

/* ---------- Philosophy ---------- */

.philosophy {
  background: var(--ink);
  color: var(--white);
  padding: var(--section-y) 0;
}
.philosophy ::selection { background: var(--blue-dark); color: var(--ink); }
.philosophy :focus-visible { outline-color: var(--blue-dark); }

.philosophy-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
}
.philosophy-intro {
  color: var(--muted-dark);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.55;
  max-width: 30em;
}

.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(24px, 3vw, 40px);
  margin-top: clamp(64px, 9vw, 120px);
}
.principles li {
  border-top: 1px solid var(--line-dark);
  padding-top: 24px;
}
.principles p {
  margin-top: 12px;
  color: var(--muted-dark);
  font-size: 1rem;
  line-height: 1.6;
}

@media (max-width: 1020px) {
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
}
@media (max-width: 760px) {
  .philosophy-head { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .principles { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- About ---------- */

.about { padding: var(--section-y) 0; }

.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}

.about-copy { max-width: 38em; }
.about-title { max-width: 11em; }
.about-copy p {
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.65;
}
.about-copy p:first-child { margin-top: 0; font-size: 1.3125rem; line-height: 1.5; color: var(--ink); }

@media (max-width: 860px) {
  .about-inner { grid-template-columns: 1fr; }
}

/* ---------- What we build ---------- */

.build { padding: 0 0 var(--section-y); }

.build-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 16px 48px;
  padding-top: var(--section-y);
  border-top: 1px solid var(--line);
}
.build-head p { color: var(--muted); max-width: 26em; font-size: 1.0625rem; }

/* Tiles sit on the brand module: 1 gap = 1/4 cell */
.areas {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: clamp(40px, 5vw, 64px);
}
.areas li {
  position: relative;
  background: var(--white);
  padding: 72px 32px 32px;
  min-height: 248px;
}
.areas li::before {
  content: "";
  position: absolute;
  left: 32px;
  top: 32px;
  width: 12px;
  height: 12px;
  background: var(--ink);
}
.areas li:last-child::before { background: var(--blue); border-radius: 50%; }
.areas p { margin-top: 12px; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.build-note { margin-top: 32px; color: var(--muted); font-size: 0.9375rem; }

@media (max-width: 960px) {
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .areas { grid-template-columns: 1fr; }
  .areas li { min-height: 0; padding: 64px 24px 28px; }
  .areas li::before { left: 24px; top: 28px; }
}

/* ---------- Contact ---------- */

.contact {
  background: var(--white);
  padding: var(--section-y) 0;
}

.contact-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: start;
}
.contact-copy p { margin-top: 20px; color: var(--muted); max-width: 26em; font-size: 1.125rem; }
.contact-copy .h2 + p { margin-top: 28px; }
.contact-copy .contact-email { margin-top: 28px; }
.contact-email a {
  color: var(--ink);
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease);
  overflow-wrap: anywhere;
}
.contact-email a:hover { color: var(--blue); }

.field-row + .field-row { margin-top: 24px; }
.field-row label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
}
.field-row input,
.field-row textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 2px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;           /* ≥16px prevents iOS zoom */
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field-row textarea { resize: vertical; min-height: 168px; }
.field-row input:hover,
.field-row textarea:hover { border-color: var(--line-strong); }
.field-row input:focus,
.field-row textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.field-row [aria-invalid="true"] { border-color: var(--error); }
.field-error { margin-top: 8px; color: var(--error); font-size: 0.9375rem; }
.field-error[hidden] { display: none; }

.hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 32px;
}
.form-privacy { color: var(--muted); font-size: 0.9375rem; flex: 1 1 220px; }
.form-privacy a { text-underline-offset: 3px; }

.form-status {
  margin-top: 28px;
  padding: 16px 20px;
  border-left: 3px solid var(--blue);
  background: var(--ground);
  font-size: 1rem;
}
.form-status[hidden] { display: none; }
.form-status.is-error { border-left-color: var(--error); }
.form-status:focus { outline: none; }
.form-status a { font-weight: 500; }

.nojs-note { display: none; }
.no-js .nojs-note {
  display: block;
  padding: 16px 20px;
  border-left: 3px solid var(--blue);
  background: var(--ground);
}
.no-js .contact-form { display: none; }

@media (max-width: 860px) {
  .contact-inner { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .form-foot .btn { width: 100%; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  font-size: 0.9375rem;
  color: var(--muted);
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px 40px;
}
.footer-brand img { width: 141px; height: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-links a { text-decoration: none; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .footer-inner { grid-template-columns: 1fr; justify-items: start; }
}

/* ---------- Legal pages (privacy, 404) ---------- */

.page {
  padding: clamp(48px, 8vw, 112px) 0 var(--section-y);
}
.page .wrap { max-width: calc(46rem + var(--gutter) * 2); }
.page h1 { font-size: clamp(2.25rem, 1.4rem + 3.2vw, 3.5rem); line-height: 1.04; font-weight: 600; letter-spacing: var(--track-display); }
.page .page-meta { margin-top: 16px; color: var(--muted); font-size: 0.9375rem; }
.page h2 { margin-top: 48px; font-size: 1.375rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
.page p, .page li { color: var(--muted); }
.page p { margin-top: 16px; }
.page ul { margin-top: 16px; padding-left: 1.2em; list-style: square; }
.page li + li { margin-top: 8px; }
.page a { color: var(--ink); text-underline-offset: 3px; }
.page strong { color: var(--ink); font-weight: 600; }
.page .lead { margin-top: 24px; }
.page .btn { margin-top: 32px; }

.simple-header .header-inner { justify-content: space-between; }
.back-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 10px 0;
}
.back-link:hover { color: var(--ink); }

@media print {
  .site-header, .site-footer, .hero-visual { display: none; }
  body { background: #fff; }
}
