/* ============================================================
   IT intelektas — "Editorial" cut
   Swiss / editorial: warm paper, hairline rules, huge type,
   numbered sections, mono metadata. One accent color.
   ============================================================ */

:root {
  --paper:   #faf8f3;
  --paper-2: #f3f0e7;
  --ink:     #181711;
  --text:    #4c4940;
  --muted:   #8d8779;
  --line:    #e3dfd2;
  --accent:  #2b6e7e;
  --on-accent: #ffffff;
  --err:     #b3402a;
  --input-bg: #ffffff;

  --font-sans:  "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --container: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
  --section-pad: clamp(72px, 9vw, 140px);
}

html[data-theme="ink"] {
  --paper:   #161510;
  --paper-2: #1c1b15;
  --ink:     #f2efe4;
  --text:    #b2ad9e;
  --muted:   #7c7768;
  --line:    #2d2b22;
  --err:     #e06a4f;
  --input-bg: #211f18;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--font-sans); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-sans); color: var(--ink); margin: 0; line-height: 1.02; letter-spacing: -0.03em; font-weight: 600; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  font-family: var(--font-mono); font-size: 13px;
}
.skip-link:focus { left: 0; }

.mono, .kicker {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.kicker { color: var(--accent); margin-bottom: 22px; }

.hl { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -0.01em; }

/* ---------- projects visibility (toggled via Tweaks) ---------- */
html[data-projects="off"] #projects,
html[data-projects="off"] a[href$="#projects"],
html[data-projects="off"] li:has(> a[href$="#projects"]) { display: none !important; }

/* ---------- reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* ---------- buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border: 1px solid var(--ink);
  font-weight: 600; font-size: 15px; letter-spacing: 0.01em;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--block { width: 100%; justify-content: center; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; color: var(--ink);
  border-bottom: 1px solid var(--ink); padding-bottom: 3px;
}
.link-arrow .arr { transition: transform 0.22s ease; }
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }
.link-arrow:hover .arr { transform: translateX(5px); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color 0.25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 72px; }
.brand__logo { height: 58px; width: auto; }
.site-footer .brand__logo { height: 64px; }
html[data-theme="ink"] .brand__logo { filter: none; }

.nav__links { display: flex; align-items: center; gap: 34px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text); padding-bottom: 4px; border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.nav__actions { display: flex; align-items: center; gap: 22px; }
.nav__actions .btn { padding: 11px 20px; font-size: 13.5px; }

.lang { display: flex; align-items: center; gap: 2px; font-family: var(--font-mono); }
.lang button {
  background: none; border: 0; padding: 6px 7px; font-family: inherit;
  font-size: 12.5px; letter-spacing: 0.08em; color: var(--muted); transition: color 0.2s ease;
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button:hover { color: var(--ink); }
.lang button.is-active { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
/* Language switch as links (prerendered i18n) */
.lang a {
  padding: 6px 7px; font-family: var(--font-mono); font-size: 12.5px;
  letter-spacing: 0.08em; color: var(--muted); transition: color 0.2s ease;
}
.lang a + a { border-left: 1px solid var(--line); }
.lang a:hover { color: var(--ink); }
.lang a.is-active { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.nav__toggle { display: none; background: none; border: 0; width: 40px; height: 40px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.nav__toggle span { display: block; width: 20px; height: 2px; background: var(--ink); transition: transform 0.25s ease, opacity 0.25s ease; }
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.menu-backdrop { position: fixed; inset: 0; background: rgba(20, 18, 12, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 60; }
.menu-backdrop.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
  background: var(--paper); border-left: 1px solid var(--line); z-index: 61;
  display: flex; flex-direction: column; gap: 6px; padding: 90px 28px 28px;
  transform: translateX(100%); transition: transform 0.3s ease;
}
.mobile-menu.is-open { transform: none; }
.mobile-menu__close {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 44px;
  background: none; border: 0; color: var(--ink);
  display: grid; place-items: center; line-height: 1;
}
.mobile-menu__close svg { width: 24px; height: 24px; }
.mobile-menu > a:not(.btn) {
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); padding: 14px 0; border-bottom: 1px solid var(--line);
}
.mobile-menu .btn { margin-top: 22px; }

/* ---------- hero ---------- */
.hero { padding: clamp(64px, 8vw, 120px) 0 clamp(48px, 6vw, 88px); }
.hero h1 {
  font-size: clamp(44px, 7.4vw, 110px); max-width: 14ch;
  margin: 0 0 clamp(28px, 4vw, 48px);
}
.hero__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.hero__sub { max-width: 52ch; font-size: 18px; }
.hero__cta { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }

.hero__meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter);
  margin-top: clamp(48px, 6vw, 88px);
}
.hero__stat { border-top: 1px solid var(--line); padding-top: 18px; }
.hero__stat strong {
  display: block; font-family: var(--font-sans); font-weight: 600;
  font-size: clamp(28px, 3vw, 44px); letter-spacing: -0.03em; color: var(--ink); line-height: 1;
}
.hero__stat span { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- marquee ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 16px 0; }
.marquee__track { display: flex; gap: 56px; width: max-content; animation: ed-marquee 36s linear infinite; }
.marquee__track span { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
@keyframes ed-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__track { animation: none; } }

/* ---------- sections ---------- */
.section { padding: var(--section-pad) 0; }
/* Anchor landing offset for the 72px sticky header (used by native and JS scroll) */
.hero, #services, #projects, #testimonials, #contact { scroll-margin-top: 72px; }
.section + .section, .section-rule { border-top: 1px solid var(--line); }

.section-head {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px var(--gutter); align-items: end; margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head .index { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--accent); display: block; margin-bottom: 18px; }
.crumb {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 3px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.crumb:hover { color: var(--accent); border-color: var(--accent); }
.section-head h1, .section-head h2 { font-size: clamp(38px, 5vw, 72px); }
.section-head .sub { max-width: 46ch; justify-self: end; align-self: end; }

/* ---------- services rows ---------- */
.svc-rows { border-top: 1px solid var(--line); }
.svc-row {
  display: grid; grid-template-columns: 80px minmax(0, 1.1fr) minmax(0, 1.5fr) 60px;
  gap: 20px var(--gutter); align-items: baseline;
  padding: clamp(26px, 3.4vw, 44px) 0; border-bottom: 1px solid var(--line);
  position: relative; transition: padding-left 0.25s ease;
}
.svc-row__num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); transition: color 0.25s ease; }
.svc-row h3 { font-size: clamp(24px, 2.6vw, 38px); font-weight: 600; transition: color 0.25s ease; }
.svc-row p { font-size: 16px; max-width: 56ch; }
.svc-row__arrow {
  justify-self: end; align-self: center; font-size: 26px; line-height: 1; color: var(--ink);
  transition: transform 0.25s ease, color 0.25s ease;
}
.svc-row:hover { padding-left: 14px; }
.svc-row:hover .svc-row__num, .svc-row:hover h3, .svc-row:hover .svc-row__arrow { color: var(--accent); }
.svc-row:hover .svc-row__arrow { transform: translateX(6px); }

.section-foot { margin-top: clamp(36px, 4vw, 56px); display: flex; justify-content: flex-start; }

/* ---------- projects ---------- */
.prj-list { display: flex; flex-direction: column; }
.prj {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 28px var(--gutter); align-items: end;
  padding: clamp(36px, 4.5vw, 64px) 0; border-top: 1px solid var(--line);
}
.prj:first-child { border-top: 0; padding-top: 0; }
.prj:nth-child(even) .prj__media { order: 2; }
.prj__media image-slot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.prj__tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 16px; }
.prj__info h3 { font-size: clamp(26px, 3vw, 42px); margin-bottom: 16px; transition: color 0.22s ease; }
.prj__info p { max-width: 44ch; }
.prj__num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: block; margin-top: 26px; }
a.prj:hover h3 { color: var(--accent); }
.svc-detail, article.prj { scroll-margin-top: 96px; }

/* ---------- testimonial ---------- */
.tst .container { max-width: 980px; }
.tst__mark { font-family: var(--font-serif); font-size: clamp(72px, 8vw, 120px); line-height: 0.6; color: var(--accent); display: block; margin-bottom: 8px; }
.tst__text {
  font-family: var(--font-sans); font-weight: 500; font-size: clamp(24px, 3vw, 40px);
  line-height: 1.3; color: var(--ink); letter-spacing: -0.02em; margin: 0 0 36px; text-wrap: balance;
}
.tst__person { display: flex; align-items: center; gap: 16px; }
.tst__person img, .tst__person image-slot { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.tst__person strong { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.tst__person span { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); margin-top: 3px; }

/* ---------- contact ---------- */
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px var(--gutter); align-items: start; }
.contact__info h2 { font-size: clamp(38px, 5vw, 72px); margin-bottom: 22px; }
.contact__lead { max-width: 44ch; margin-bottom: 40px; }
.contact__mail {
  display: inline-block; font-weight: 600; color: var(--ink);
  font-size: clamp(20px, 2.4vw, 32px); letter-spacing: -0.02em;
  border-bottom: 2px solid var(--accent); padding-bottom: 4px; margin-bottom: 18px;
  transition: color 0.2s ease;
}
.contact__mail:hover { color: var(--accent); }
.contact__phone { display: block; font-family: var(--font-mono); font-size: 15px; color: var(--text); margin-bottom: 44px; }
.contact__phone:hover { color: var(--accent); }
.contact__socials { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.contact__socials a {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; color: var(--text);
  border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: color 0.2s ease, border-color 0.2s ease;
}
.contact__socials a:hover { color: var(--accent); border-color: var(--accent); }

/* form */
.form { border-top: 1px solid var(--line); padding-top: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.field { padding: 18px 0 6px; }
.field label {
  display: block; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding: 8px 0 12px; font-family: var(--font-sans); font-size: 17px; color: var(--ink);
  border-radius: 0; transition: border-color 0.2s ease;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.7; }
.field__err { display: none; font-family: var(--font-mono); font-size: 11.5px; color: var(--err); margin-top: 8px; }
.field.has-error input, .field.has-error textarea { border-bottom-color: var(--err); }
.field.has-error .field__err { display: block; }
.form .btn { margin-top: 28px; }
.form-success {
  display: none; align-items: center; gap: 10px; margin-top: 18px;
  font-family: var(--font-mono); font-size: 13px; color: var(--accent);
}
.form-success.is-shown { display: flex; }
.form-success svg { width: 18px; height: 18px; }
.form-success.is-error { color: var(--err); }
/* Honeypot — visually & assistively hidden, but present for bots to trip on */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn.is-sending { opacity: 0.6; pointer-events: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: clamp(48px, 6vw, 80px) 0 32px; }
.footer__top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px var(--gutter); margin-bottom: clamp(40px, 5vw, 64px); }
.footer__about { max-width: 38ch; margin-top: 18px; font-size: 15px; }
.footer__col h4 { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.footer__col ul a { color: var(--text); font-size: 15px; transition: color 0.2s ease; }
.footer__col ul a:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
}
.footer__bottom p { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.footer__bottom .contact__socials a { font-size: 12px; }

/* ---------- to top ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 46px; height: 46px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  display: grid; place-items: center; opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}
.to-top.is-shown { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--ink); color: var(--paper); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- service detail blocks (Services page) ---------- */
.svc-details { border-top: 1px solid var(--line); }
.svc-detail {
  display: grid; grid-template-columns: 80px minmax(0, 1.1fr) minmax(0, 1.5fr);
  gap: 20px var(--gutter); align-items: start;
  padding: clamp(36px, 4.5vw, 64px) 0; border-bottom: 1px solid var(--line);
}
.svc-detail__num { font-family: var(--font-mono); font-size: 13px; color: var(--muted); padding-top: 8px; }
.svc-detail h3 { font-size: clamp(28px, 3.2vw, 48px); }
.svc-detail .stack, .svc-page .stack {
  display: block; margin-top: 16px; font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.svc-detail__body p { max-width: 56ch; margin-bottom: 28px; }

/* ---------- single service page ---------- */
.svc-page { max-width: 760px; }
.svc-page .stack { margin: 0 0 28px; }
.svc-page p { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.7; }

/* ---------- single project page ---------- */
.prj-page__media image-slot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prj-page p { max-width: 62ch; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.7; margin-top: 32px; }

/* ---------- CTA band (subpages) ---------- */
.cta-band { border-top: 1px solid var(--line); padding: clamp(32px, 4vw, 52px) 0 clamp(40px, 5vw, 64px); }
.cta-band__link {
  display: inline-flex; align-items: baseline; gap: 0.35em;
  font-size: clamp(34px, 5vw, 76px); font-weight: 600; letter-spacing: -0.03em;
  color: var(--ink); border-bottom: 3px solid var(--accent); padding-bottom: 10px;
  transition: color 0.22s ease;
}
.cta-band__link:hover { color: var(--accent); }
.cta-band__link .arr { font-size: 0.7em; transition: transform 0.22s ease; }
.cta-band__link:hover .arr { transform: translate(6px, -2px); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .nav__links { display: none; }
  .nav__actions .btn { display: none; }
  .nav__toggle { display: flex; }
  .section-head { grid-template-columns: 1fr; }
  .section-head .sub { justify-self: start; }
  .svc-row { grid-template-columns: 48px minmax(0, 1fr) 40px; }
  .svc-detail { grid-template-columns: 48px minmax(0, 1fr); }
  .svc-detail__body { grid-column: 2; }
  .svc-row p { grid-column: 2; }
  .svc-row__arrow { grid-row: 1; grid-column: 3; }
  .prj, .contact__grid { grid-template-columns: 1fr; }
  .prj { align-items: start; }
  .prj:nth-child(even) .prj__media { order: 0; }
}
@media (max-width: 640px) {
  .hero__meta { grid-template-columns: 1fr; gap: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr; }

  /* tighten vertical rhythm so anchored sections don't land with a big gap */
  .section { padding: 56px 0; }

  /* hero: copy stacks full width, justified to both edges */
  .hero__row { flex-direction: column; align-items: stretch; gap: 24px; }
  .hero__sub { max-width: none; text-align: justify; }

  /* services: intro + per-row descriptions full width, justified */
  .section-head .sub { max-width: none; text-align: justify; }
  .svc-row p { grid-column: 1 / -1; max-width: none; text-align: justify; }

  /* contact: make fields read as clear input boxes on the paper background */
  .field { padding: 12px 0 0; }
  .field input, .field textarea {
    background: var(--input-bg); border: 1px solid var(--line); border-radius: 10px;
    padding: 14px 14px; font-size: 16px; /* 16px keeps iOS from zooming on focus */
  }
  .field input:focus, .field textarea:focus { border-color: var(--accent); }
  .field.has-error input, .field.has-error textarea { border-color: var(--err); }
}
