/* ==========================================================================
   Torrington Automation — landing page
   ========================================================================== */

:root {
  --ink: #0b1220;
  --ink-soft: #26313f;
  --muted: #5b6675;
  --line: #e4e8ee;
  --surface: #ffffff;
  --surface-alt: #f6f8fb;
  --accent: #2f5bff;
  --accent-dark: #1e42d8;
  --accent-soft: #ecf1ff;
  --green: #0f9d6e;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .06), 0 4px 12px rgba(11, 18, 32, .04);
  --shadow-md: 0 12px 32px rgba(11, 18, 32, .10), 0 2px 8px rgba(11, 18, 32, .05);
  --max: 1160px;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 700;
}

p { margin: 0; }

ul, ol, dl { margin: 0; padding: 0; list-style: none; }

button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
}
.skip-link:focus { left: 16px; }

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

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
  position: relative;
}

.btn-primary {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  box-shadow: 0 6px 18px rgba(47, 91, 255, .26), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { --btn-bg: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(47, 91, 255, .32); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: #cfd6e2; transform: translateY(-1px); }

.btn-sm { padding: 10px 18px; font-size: .875rem; }
.btn-block { width: 100%; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 1px 20px rgba(11, 18, 32, .05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--accent);
  font-weight: 700;
}
.brand-mark { width: 32px; height: 32px; flex: none; color: var(--accent); }
.brand-name {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-size: 1.02rem;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.brand-suffix {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: .925rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav a { transition: color .18s ease; }
.nav a:hover { color: var(--accent); }
.nav a.btn { color: #fff; }
.nav a.btn:hover { color: #fff; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .22s ease, opacity .22s ease;
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 23px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

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

.hero {
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0 0;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: -180px auto auto -140px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(47, 91, 255, .16), rgba(47, 91, 255, 0) 68%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 91, 255, .14);
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  letter-spacing: -.035em;
  font-weight: 750;
}

.grad {
  background: linear-gradient(100deg, var(--accent) 10%, #7c5cff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin-top: 22px;
  max-width: 54ch;
  color: var(--muted);
  font-size: clamp(1rem, 1.3vw, 1.1rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(20px, 4vw, 44px);
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.hero-stats > div { display: flex; flex-direction: column-reverse; gap: 2px; }
.hero-stats dt {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
}
.hero-stats dd {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
}

/* Hero visual card */

.hero-visual { position: relative; }

.card-flow {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.card-flow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(600px 200px at 110% -10%, rgba(47, 91, 255, .10), transparent 60%);
  pointer-events: none;
}

.card-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.pill-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 157, 110, .10);
  color: var(--green);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .02em;
}
.pill-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 157, 110, .45); }
  50% { box-shadow: 0 0 0 5px rgba(15, 157, 110, 0); }
}

.flow {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 0 6px;
  position: relative;
  z-index: 1;
}

.flow-step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 6px;
}
.flow-step + .flow-step::before {
  content: "";
  position: absolute;
  left: 11px;
  top: -8px;
  height: 18px;
  width: 2px;
  background: var(--line);
}

.flow-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #cfd6e2;
  background: #fff;
  flex: none;
  margin-left: 5px;
  position: relative;
  z-index: 1;
}
.flow-step.is-done .flow-node { border-color: var(--green); background: var(--green); }
.flow-step.is-run .flow-node { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(47, 91, 255, .15); }

.flow-step > div { display: flex; flex-direction: column; min-width: 0; }
.flow-step strong { font-size: .875rem; font-weight: 600; letter-spacing: -.01em; }
.flow-step small { color: var(--muted); font-size: .78rem; }

.flow-badge {
  margin-left: auto;
  flex: none;
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--green);
}
.badge-run { color: var(--accent); }
.badge-idle { color: #9aa4b2; }

.card-flow-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  position: relative;
  z-index: 1;
}
.spark {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  flex: none;
}

/* Trust strip */

.trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: clamp(48px, 6vw, 76px);
  padding-block: 22px;
  border-top: 1px solid var(--line);
}
.trust-label {
  font-size: .76rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #98a2b3;
}
.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  color: var(--ink-soft);
  font-size: .92rem;
  font-weight: 600;
}
.trust-list li { opacity: .72; }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 9vw, 108px) 0; }
.section-alt {
  background: var(--surface-alt);
  border-block: 1px solid var(--line);
}

.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }

.section-head h2,
.about-copy h2,
.contact-copy h2 {
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  letter-spacing: -.03em;
}

.section-sub {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ---------- Services ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.service {
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.service:hover {
  transform: translateY(-4px);
  border-color: #d3dbe8;
  box-shadow: var(--shadow-md);
}

.service-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 20px;
}
.service-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service h3 {
  font-size: 1.14rem;
  letter-spacing: -.02em;
}

.service > p {
  margin-top: 12px;
  color: var(--muted);
  font-size: .94rem;
}

.service-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.service-list li {
  position: relative;
  padding-left: 22px;
  font-size: .875rem;
  color: var(--ink-soft);
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .58em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

.service-meta {
  margin-top: auto;
  padding-top: 20px;
  color: #8a94a3;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
}

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

.about {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
}

.about-copy p:not(.eyebrow) {
  margin-top: 16px;
  color: var(--muted);
  font-size: .99rem;
  max-width: 56ch;
}

.values {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 32px;
}
.values li { display: flex; gap: 13px; align-items: flex-start; }
.values svg {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
  fill: none;
  stroke: var(--green);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: rgba(15, 157, 110, .10);
  border-radius: 50%;
  padding: 4px;
}
.values div { display: flex; flex-direction: column; gap: 2px; }
.values strong { font-size: .94rem; letter-spacing: -.01em; }
.values span { color: var(--muted); font-size: .875rem; }

.about-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-card:first-child { grid-column: span 2; }
.stat-number {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -.03em;
}
.stat-label { color: var(--muted); font-size: .84rem; line-height: 1.45; }

.quote {
  grid-column: span 2;
  margin: 0;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}
.quote p {
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -.01em;
  margin: 0;
}
.quote footer {
  margin-top: 14px;
  color: rgba(255, 255, 255, .58);
  font-size: .8rem;
}

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

.contact {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.contact-info li { display: flex; flex-direction: column; gap: 3px; }
.ci-label {
  color: #98a2b3;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.contact-info a,
.contact-info span:not(.ci-label) {
  font-size: .96rem;
  font-weight: 550;
  color: var(--ink);
}
.contact-info a:hover { color: var(--accent); }

.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(24px, 3vw, 34px);
  box-shadow: var(--shadow-md);
}

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field label {
  font-size: .82rem;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--ink-soft);
}
.optional { color: #98a2b3; font-weight: 500; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: .94rem;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  appearance: none;
}
.field textarea { resize: vertical; min-height: 104px; }
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6675' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.field input::placeholder,
.field textarea::placeholder { color: #a9b2bf; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 91, 255, .12);
}

.field.has-error input,
.field.has-error textarea { border-color: #e2453a; }
.field.has-error input:focus,
.field.has-error textarea:focus { box-shadow: 0 0 0 4px rgba(226, 69, 58, .12); }

.error {
  margin: 0;
  min-height: 0;
  color: #d63a2f;
  font-size: .78rem;
  font-weight: 500;
}

.form-note {
  margin-top: 14px;
  text-align: center;
  color: #98a2b3;
  font-size: .78rem;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .btn-spinner { display: block; }
.btn.is-loading .btn-label { opacity: .85; }

.form-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 8px 2px;
  animation: fade-up .45s ease both;
}
.form-success[hidden] { display: none; }
.success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(15, 157, 110, .12);
  color: var(--green);
}
.success-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.form-success h3 { font-size: 1.2rem; letter-spacing: -.02em; }
.form-success p { color: var(--muted); font-size: .94rem; }
.form-success .btn { margin-top: 6px; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

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

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, .66);
  padding: clamp(48px, 6vw, 68px) 0 28px;
}

.site-footer .brand { color: #8fa8ff; }
.site-footer .brand-mark { color: #8fa8ff; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-suffix { color: rgba(255, 255, 255, .48); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand { max-width: 340px; }
.footer-brand p {
  margin-top: 16px;
  font-size: .9rem;
  line-height: 1.6;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(40px, 8vw, 96px);
}
.footer-nav > div { display: flex; flex-direction: column; gap: 11px; }
.footer-nav h4 {
  margin: 0 0 3px;
  color: #fff;
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.footer-nav a {
  font-size: .9rem;
  transition: color .18s ease;
}
.footer-nav a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: clamp(36px, 5vw, 52px);
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  font-size: .8rem;
  color: rgba(255, 255, 255, .44);
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: 2; max-width: 560px; }
  .grid-3 { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .about-panel { grid-template-columns: repeat(2, 1fr); }
  .about-panel .stat-card:first-child { grid-column: span 2; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 76px; }
  .header-inner { height: 66px; }

  .nav-toggle { display: block; }

  .nav {
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 24px 22px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(11, 18, 32, .07);
    transform-origin: top;
    display: none;
  }
  .nav.is-open { display: flex; animation: fade-up .22s ease both; }
  .nav a { padding: 11px 4px; font-size: 1rem; }
  .nav a.btn { margin-top: 8px; padding: 13px 20px; text-align: center; }

  .hero { padding-top: 44px; }
  .hero-stats { gap: 24px; }
  .hero-stats dd { font-size: 1.28rem; }

  .field-row { grid-template-columns: 1fr; gap: 0; }
  .about-panel { grid-template-columns: 1fr; }
  .about-panel .stat-card:first-child,
  .quote { grid-column: span 1; }

  .footer-inner { flex-direction: column; }
  .footer-nav { gap: 36px; }
}

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