/* NMZZ — independent software studio */
:root {
  --bg: #f4f1ea;
  --paper: #fbf9f4;
  --ink: #1d1c19;
  --body: #3e3a33;
  --muted: #6d675d;
  --line: #d8d2c6;
  --line-dark: #b9b1a2;
  --accent: #2f5a4e;
  --accent-2: #c45a32;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img, svg { max-width: 100%; }
.wrap { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px; min-height: 72px; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 27px; font-weight: 600;
  letter-spacing: -0.02em; text-decoration: none; line-height: 1;
}
.brand span { color: var(--accent-2); }
.nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-color: var(--accent-2);
}
.lang-switch {
  display: flex; gap: 6px; align-items: center;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.lang-switch a { color: var(--muted); text-decoration: none; }
.lang-switch a.is-active { color: var(--ink); }
.lang-switch span { color: var(--line-dark); }

/* Typography */
h1, h2, h3, h4 { color: var(--ink); }
h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(44px, 7vw, 84px);
  line-height: 0.98; letter-spacing: -0.035em;
  margin: 0 0 24px;
}
h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.04; letter-spacing: -0.025em;
  margin: 0 0 18px;
}
h3 {
  font-family: var(--serif); font-weight: 600;
  font-size: 24px; line-height: 1.15;
  margin: 0 0 10px;
}
p { margin: 0 0 1em; }
.eyebrow {
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--accent); margin: 0 0 18px;
}
.lead {
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.45; color: var(--muted);
  max-width: 35em;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }

/* Hero */
.hero { padding: 84px 0 72px; border-bottom: 1px solid var(--line); }
.hero-grid {
  display: grid; grid-template-columns: 1.45fr 0.75fr;
  gap: 64px; align-items: start;
}
.actions { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-top: 36px; }
.button {
  display: inline-flex; gap: 10px; align-items: center;
  background: var(--ink); color: var(--bg);
  padding: 13px 18px; text-decoration: none;
  font-size: 14px; line-height: 1;
  transition: background 160ms ease;
}
.button:hover { background: var(--accent); color: var(--paper); }
.text-link { font-size: 14px; color: var(--ink); }
.text-link:hover { color: var(--accent); }
.hero-aside { border-left: 1px solid var(--line); padding-left: 32px; }
.status {
  display: flex; gap: 10px; align-items: center;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.status-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.facts { margin: 28px 0 0; display: grid; gap: 18px; }
.facts div { border-top: 1px solid var(--line); padding-top: 12px; }
.facts dt {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.facts dd { margin: 4px 0 0; font-size: 14px; }

/* Sections */
.section { padding: 72px 0; border-bottom: 1px solid var(--line); }
.section-alt { background: var(--paper); }
.section-head {
  display: flex; justify-content: space-between;
  align-items: end; gap: 32px; margin-bottom: 36px;
}
.section-head p { max-width: 36em; margin-bottom: 0; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card { border-top: 1px solid var(--ink); padding-top: 18px; }
.service-card .num {
  display: block; font-family: var(--mono); font-size: 11px;
  color: var(--accent); margin-bottom: 18px;
}
.service-card h3 { font-size: 26px; }
.service-card p { color: var(--muted); font-size: 15px; }
.service-card .tags { margin-top: 16px; }

/* Work */
.work-list { display: grid; gap: 0; }
.work-item {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  align-items: start;
  gap: 48px; padding: 36px 0; border-top: 1px solid var(--line);
}
.work-item:first-child { border-top: 1px solid var(--ink); }
.work-item h3 { font-size: 31px; }
.work-item p { color: var(--muted); }
.work-item .meta { margin-bottom: 8px; }
.meta {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted);
}
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tag {
  border: 1px solid var(--line); padding: 3px 8px;
  font-family: var(--mono); font-size: 10px; color: var(--muted);
}
.project-code {
  background: #1d1c19; color: #e9e4d9;
  padding: 20px; overflow: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  margin: 18px 0 0;
}
.project-code code { color: inherit; }

/* Notes */
.notes-list { display: grid; gap: 0; }
.note-item {
  display: grid; grid-template-columns: 160px 1fr auto;
  gap: 24px; align-items: baseline;
  padding: 20px 0; border-top: 1px solid var(--line);
  text-decoration: none;
}
.note-item:first-child { border-top: 1px solid var(--ink); }
.note-item h3 { font-size: 22px; margin: 0; transition: color 160ms ease; }
.note-item:hover h3 { color: var(--accent); }
.note-item .date, .note-item .arrow {
  font-family: var(--mono); font-size: 10px;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
}

/* CTA */
.cta { padding: 72px 0; }
.cta-inner { display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.cta h2 { max-width: 15em; margin-bottom: 0; }
.cta a.email {
  font-family: var(--serif); font-size: clamp(22px, 3vw, 36px);
  text-decoration: underline; text-underline-offset: 6px;
}

/* Page header and prose */
.page-header { padding: 72px 0 40px; border-bottom: 1px solid var(--line); }
.page-header h1 { font-size: clamp(38px, 6vw, 70px); margin-bottom: 0; }
.page-header .lead { margin-top: 18px; margin-bottom: 0; }
.page-body { padding: 56px 0 72px; }
.prose { max-width: 780px; }
.prose h2 { font-size: 30px; margin-top: 48px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 34px; }
.prose p, .prose li { color: var(--body); }
.prose code {
  font-family: var(--mono); font-size: 0.9em;
  background: #e9e4d9; padding: 2px 5px;
}
.prose pre {
  background: #1d1c19; color: #e9e4d9;
  padding: 20px; overflow: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
  margin: 24px 0;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote {
  border-left: 2px solid var(--accent);
  margin: 24px 0; padding-left: 18px; color: var(--muted);
}
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.prose th, .prose td {
  text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px;
}
.prose th { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.note-meta {
  display: flex; gap: 18px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 24px;
}

/* Services detail */
.service-detail {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 40px; padding: 32px 0; border-top: 1px solid var(--line);
}
.service-detail:first-of-type { border-top: 1px solid var(--ink); }
.service-detail h3 { font-size: 28px; }
.service-detail p { color: var(--body); }
.process { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.process div { border-top: 1px solid var(--ink); padding-top: 16px; }
.process .num { font-family: var(--mono); font-size: 11px; color: var(--accent); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.contact-email {
  font-family: var(--serif); font-size: clamp(28px, 4vw, 48px);
  text-decoration: underline; text-underline-offset: 6px;
  display: inline-block; margin: 12px 0 24px;
}

/* Diagram */
.diagram {
  margin-top: 32px; display: grid; gap: 0;
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
}
.diagram .node { border: 1px solid var(--line); padding: 10px 12px; background: var(--paper); }
.diagram .node-accent { border-color: var(--accent); color: var(--accent); }
.diagram .line { width: 1px; height: 18px; background: var(--line); margin-left: 18px; }

/* Footer */
.site-footer { background: var(--ink); color: #d9d3c7; padding: 56px 0 24px; }
.site-footer .brand { color: #f4f1ea; }
.site-footer .brand span { color: #d9825f; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #8f887b; margin: 0 0 10px;
}
.site-footer a { color: #d9d3c7; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer p { color: #a9a294; font-size: 14px; }
.footer-links { display: grid; gap: 6px; font-size: 14px; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid #3a3833; margin-top: 44px; padding-top: 18px;
  font-family: var(--mono); font-size: 10px; color: #8f887b;
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid, .work-item, .contact-grid, .footer-grid, .service-detail {
    grid-template-columns: 1fr;
  }
  .hero-aside { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 28px; }
  .services-grid, .process { grid-template-columns: 1fr; }
  .section-head, .cta-inner { display: block; }
  .note-item { grid-template-columns: 1fr auto; }
  .note-item .date { grid-column: 1 / -1; }
  .nav { gap: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .hero { padding: 56px 0 48px; }
  .section { padding: 52px 0; }
  .header-inner { min-height: auto; padding: 14px 0; }
  .lang-switch { margin-left: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .note-item h3 { transition: none; }
}
