/* ============================================================
   Townsman Software | design system
   Light & minimal, papaya-orange accent, enterprise-grade type.
   ============================================================ */

:root {
  /* palette */
  --bg: #ffffff;
  --bg-subtle: #f6f7f8;
  --bg-dark: #111214;
  --ink: #111214;
  --ink-2: #3d4147;
  --muted: #6b7280;
  --line: #e6e8eb;
  --accent: #ff8000;          /* papaya orange */
  --accent-strong: #e56f00;
  --accent-soft: #fff3e6;
  --success: #157f3d;
  --error: #c4371f;

  /* type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  /* metrics */
  --container: 1160px;
  --radius: 10px;
  --nav-h: 68px;

  --shadow-sm: 0 1px 2px rgba(17, 18, 20, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(17, 18, 20, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(17, 18, 20, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 760;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.28rem; letter-spacing: -0.015em; }

p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 620;
  font-size: 0.98rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(255, 128, 0, 0.55);
}
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 8px 20px -6px rgba(255, 128, 0, 0.6); }

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--ink); }

.btn-sm { padding: 9px 16px; font-size: 0.9rem; }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 680;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  text-transform: none;
  font-weight: 600;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-brand { display: flex; align-items: center; }
.nav-brand img { height: 42px; width: auto; }

.nav-menu { display: flex; align-items: center; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 0.95rem;
  font-weight: 560;
  color: var(--ink-2);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-actions { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 640;
}
.lang-btn {
  padding: 6px 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn.active { background: var(--ink); color: #fff; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: clamp(72px, 11vw, 130px) 0 clamp(60px, 8vw, 96px);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(640px 320px at 85% -10%, rgba(255, 128, 0, 0.1), transparent 70%),
    radial-gradient(520px 260px at 8% 110%, rgba(255, 128, 0, 0.06), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 820px; }
.hero h1 { margin-top: 22px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub {
  font-size: clamp(1.06rem, 1.8vw, 1.25rem);
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 34px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-alt { background: var(--bg-subtle); }
.section-head { max-width: 680px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.section-head .badge { margin-bottom: 16px; }

/* ---------- trust band ---------- */
.trust-band {
  border-block: 1px solid var(--line);
  padding: 44px 0;
  background: var(--bg);
}
.trust-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 6vw, 64px);
  flex-wrap: wrap;
  text-align: center;
}
.trust-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.trust-logo img {
  height: 64px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.75;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.trust-logo:hover img { filter: none; opacity: 1; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #d8dbdf;
}
.card-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  margin-bottom: 18px;
}
.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.98rem; margin-bottom: 16px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 0.78rem;
  font-weight: 620;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

/* ---------- feature rows ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
  padding: clamp(32px, 4vw, 48px) 0;
}
.feature-row + .feature-row { border-top: 1px solid var(--line); }
.feature-row.reverse .feature-media { order: 2; }
.feature-row h3 { font-size: 1.6rem; }
.feature-row p { color: var(--muted); }
.feature-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.feature-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--ink-2);
  font-size: 0.98rem;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4.5 8.5l2.3 2.3 4.7-5' stroke='%23e56f00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px;
  background-repeat: no-repeat;
}
.feature-media {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.feature-media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- terminal / quant panel ---------- */
.terminal {
  background: var(--bg-dark);
  color: #d6dae0;
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  font-family: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  box-shadow: var(--shadow-lg);
  overflow-x: auto;
}
.terminal-bar {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}
.terminal-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a3d42;
  display: block;
}
.terminal-bar i:first-child { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal .t-prompt { color: var(--accent); }
.terminal .t-key { color: #7dd3fc; }
.terminal .t-num { color: #f0b429; }
.terminal .t-ok { color: #34d399; }
.terminal .t-dim { color: #6b7280; }

/* ---------- quote / case ---------- */
.quote-card {
  background: var(--bg-dark);
  color: #e8eaed;
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(36px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.quote-card blockquote {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 560;
  line-height: 1.45;
  letter-spacing: -0.015em;
}
.quote-card blockquote footer {
  margin-top: 22px;
  font-size: 0.95rem;
  color: #9aa0a8;
}
.quote-logo {
  display: flex;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 30px;
}
.quote-logo img { height: 92px; width: auto; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--bg-dark);
  color: #fff;
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 260px at 50% -20%, rgba(255, 128, 0, 0.22), transparent 70%);
  pointer-events: none;
}
.cta-band h2 { position: relative; color: #fff; }
.cta-band p { position: relative; color: #b6bbc2; max-width: 560px; margin-inline: auto; }
.cta-band .btn { position: relative; margin-top: 14px; }

/* ---------- page hero (inner pages) ---------- */
.page-hero {
  padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 5vw, 64px);
  background:
    radial-gradient(560px 260px at 90% -20%, rgba(255, 128, 0, 0.09), transparent 70%);
}
.page-hero h1 { margin-top: 18px; max-width: 780px; }
.page-hero p.lead {
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  color: var(--muted);
  max-width: 660px;
}

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.form-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(26px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 620;
  margin-bottom: 7px;
}
.form-field label .req { color: var(--accent-strong); }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.97rem;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 128, 0, 0.18);
}
.form-field textarea { resize: vertical; min-height: 130px; }

/* honeypot | invisible to humans, irresistible to bots */
.hp-wrap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 560;
  display: none;
}
.form-status.ok { display: block; background: #e8f7ee; color: var(--success); border: 1px solid #bfe6cd; }
.form-status.err { display: block; background: #fdecea; color: var(--error); border: 1px solid #f5c6bf; }

.contact-aside .card { margin-bottom: 20px; }
.contact-aside h3 { font-size: 1.05rem; margin-bottom: 8px; }
.contact-aside p { font-size: 0.94rem; }
.contact-aside a.mail {
  color: var(--accent-strong);
  font-weight: 640;
  word-break: break-all;
}
.contact-aside a.mail:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.footer {
  background: var(--bg-dark);
  color: #9aa0a8;
  padding: clamp(48px, 7vw, 80px) 0 32px;
  margin-top: clamp(64px, 9vw, 110px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  margin-bottom: 48px;
}
.footer-brand img { height: 38px; width: auto; margin-bottom: 16px; }
.footer-brand p { font-size: 0.92rem; max-width: 320px; }
.footer h4 {
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer ul li { margin-bottom: 10px; }
.footer ul a { font-size: 0.95rem; transition: color 0.15s ease; }
.footer ul a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #26282c;
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
}

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .quote-card { grid-template-columns: 1fr; }
  .quote-logo { max-width: 360px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
  .feature-row.reverse .feature-media { order: 0; }
  .form-row { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-flex; }
  .nav-menu {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
    padding: 16px 24px 22px;
  }
  .nav-menu.open { display: block; }
  .nav-links { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
  .nav-menu .btn { display: flex !important; width: 100%; justify-content: center; }
  .nav-cta-desktop { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}
