/* KCA.net — IPv4 leasing
   Palette: rack-label paper, cable-ink, port-teal, signal yellow */
:root {
  --paper: #F1F3EF;
  --paper-2: #E4E9E5;
  --ink: #16242C;
  --ink-2: #22343E;
  --muted: #4F6069;
  --line: #C3CDCB;
  --teal: #0C6B82;
  --teal-dark: #08546A;
  --signal: #E3AE1E;
  --signal-dark: #C9970E;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section: clamp(4.5rem, 9vw, 7.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-variation-settings: "wdth" 100;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 750; }
h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-stretch: 112%;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.015em;
  max-width: 22ch;
}
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--teal-dark); }

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

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem;
}
.skip:focus { top: 1rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85rem 1.35rem; min-height: 48px;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2;
  text-decoration: none; border: 2px solid transparent; border-radius: 3px;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--teal); color: #fff; }
.btn-quiet { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-quiet:hover { background: var(--ink); color: var(--paper); }
.btn-signal { background: var(--signal); color: var(--ink); }
.btn-signal:hover { background: var(--signal-dark); color: var(--ink); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(241, 243, 239, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; }
.logo {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--ink); text-decoration: none;
  font-weight: 800; font-size: 1.35rem; font-variation-settings: "wdth" 125; letter-spacing: -.01em;
}
.logo svg { width: 28px; height: 28px; color: var(--ink); }
.logo-tld { color: var(--teal); font-weight: 600; }
.logo:hover { color: var(--ink); }

nav ul { display: flex; gap: 1.75rem; align-items: center; list-style: none; margin: 0; padding: 0; }
nav a { color: var(--ink); text-decoration: none; font-weight: 550; font-size: .98rem; }
nav a:hover { color: var(--teal); }
nav .nav-cta { background: var(--ink); color: var(--paper); padding: .55rem 1rem; border-radius: 3px; }
nav .nav-cta:hover { background: var(--teal); color: #fff; }
.nav-toggle {
  display: none; font: inherit; font-weight: 600; background: none;
  border: 2px solid var(--ink); border-radius: 3px; padding: .45rem .9rem; color: var(--ink); cursor: pointer;
}

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(4rem, 8vw, 7rem); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2.5rem, 5vw, 5rem); align-items: center; }
.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.1rem);
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.025em;
  line-height: 1.02;
  max-width: 15ch;
  margin-bottom: 1.5rem;
}
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 36em; max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2rem; }

/* Prefix explorer */
.explorer {
  background: var(--ink); color: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 4px;
}
.explorer-title { font-size: 1.35rem; font-variation-settings: "wdth" 110; max-width: none; margin-bottom: .4rem; }
.explorer-sub { color: #AFC0C4; font-size: .95rem; margin-bottom: 1.5rem; max-width: 46ch; }

.bits { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1.6rem; }
.octet { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.bit {
  aspect-ratio: 1 / 2; border-radius: 1px;
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.bit.net { background: var(--teal); color: #CFE6EC; border: 1px solid var(--teal); }
.bit.host { background: transparent; color: var(--signal); border: 1px solid var(--signal); }
.octet-label { grid-column: 1 / -1; font-size: .72rem; color: #8FA3A9; margin-top: .35rem; font-variant-numeric: tabular-nums; }

.prefix-control label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.prefix-control input[type=range] { width: 100%; accent-color: var(--signal); height: 28px; cursor: pointer; }
.scale { display: flex; justify-content: space-between; font-size: .78rem; color: #8FA3A9; margin-top: .1rem; }

.readout {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem;
  margin: 1.5rem 0 1.75rem; padding: 1.25rem 0; border-top: 1px solid #34505C; border-bottom: 1px solid #34505C;
}
.readout dt { font-size: .82rem; color: #8FA3A9; }
.readout dd {
  margin: .1rem 0 0; font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums;
  font-variation-settings: "wdth" 108; letter-spacing: -.01em;
}
#r-prefix { color: var(--signal); }
.explorer .btn { width: 100%; }

/* Sections */
.section { padding: var(--section) 0; }
.section > .wrap > h2 { margin-bottom: 1.25rem; }
.section-lede { font-size: 1.15rem; max-width: 56ch; color: inherit; opacity: .85; margin-bottom: 3rem; }
.two-col { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.col-intro h2 { margin-bottom: 1.25rem; }
.col-intro p { color: var(--ink-2); max-width: 46ch; }

/* Compare table */
.compare { overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: .98rem; min-width: 520px; }
.compare th, .compare td { text-align: left; padding: 1rem .9rem; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare thead th { font-weight: 700; border-bottom: 2px solid var(--ink); padding-top: 0; }
.compare thead th:nth-child(2) { color: var(--teal); }
.compare tbody th { font-weight: 650; width: 24%; }
.compare td:nth-child(2) { background: rgba(12, 107, 130, .07); font-weight: 550; }
.compare td:nth-child(3) { color: var(--muted); }

/* Included (dark) */
.section-ink { background: var(--ink); color: var(--paper); }
.section-ink h2 { color: var(--paper); }
.included-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #34505C;
}
.included-grid article { padding: 1.75rem 1.75rem 1.75rem 0; border-bottom: 1px solid #34505C; }
.included-grid article:not(:nth-child(3n+1)) { padding-left: 1.75rem; border-left: 1px solid #34505C; }
.included-grid h3 { margin-bottom: .6rem; color: #fff; }
.included-grid h3::before {
  content: ""; display: inline-block; width: .6em; height: .6em; margin-right: .55em;
  border: 2px solid var(--signal); vertical-align: .05em;
}
.included-grid p { color: #B9C8CB; margin: 0; font-size: 1rem; }

/* Steps */
.steps { list-style: none; counter-reset: step; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 1.75rem 0 0; }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 2.75rem; height: 2.75rem; margin-bottom: 1.25rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 50%;
  font-weight: 750; font-size: 1.1rem; position: relative; z-index: 1;
}
.steps li::after {
  content: ""; position: absolute; top: 1.375rem; left: 2.75rem; right: 0; height: 2px; background: var(--line);
}
.steps li:last-child::after { display: none; }
.steps li:last-child::before { background: var(--signal); border-color: var(--signal); }
.steps h3 { margin-bottom: .5rem; }
.steps p { color: var(--ink-2); font-size: 1rem; }

/* Who */
.section-tint { background: var(--paper-2); }
.who-list { list-style: none; margin: 0; padding: 0; }
.who-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.who-list li:first-child { border-top: 1px solid var(--line); }
.who-list strong { color: var(--ink); display: block; font-size: 1.1rem; margin-bottom: .15rem; }

/* Policy */
.policy { padding: clamp(3.5rem, 7vw, 5.5rem) 0; border-bottom: 1px solid var(--line); }
.policy-inner { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(2rem, 5vw, 5rem); align-items: baseline; }
.policy h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); }
.policy p { margin: 0; font-size: 1.1rem; color: var(--ink-2); max-width: 60ch; }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.15rem 2.5rem 1.15rem 0; position: relative;
  font-weight: 650; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--teal); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq summary:hover { color: var(--teal); }
.faq details p { color: var(--ink-2); max-width: 62ch; padding-bottom: .5rem; }

/* Contact */
.contact { background: var(--ink); color: var(--paper); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.contact h2 { color: var(--paper); margin-bottom: 1.25rem; }
.contact-intro > p { color: #C4D2D5; max-width: 44ch; }
.direct { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #34505C; }
.direct p { margin: 0 0 .35rem; color: #8FA3A9; }
.direct a { color: var(--paper); font-weight: 650; font-size: 1.2rem; text-decoration: none; border-bottom: 2px solid var(--signal); }
.direct a:hover { color: var(--signal); }

.quote-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem;
  background: var(--paper); color: var(--ink); padding: clamp(1.5rem, 3vw, 2.25rem); border-radius: 4px;
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  padding: .7rem .8rem; min-height: 46px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 3px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); outline: 2px solid var(--teal); outline-offset: 0; }
.field input[aria-invalid="true"] { border-color: #B3261E; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: .4rem; }
.form-status { margin: 0; font-size: .95rem; }
.form-status.error { color: #B3261E; }
.form-status.ok { color: var(--teal-dark); }

/* Footer */
.site-footer { background: #0E181E; color: #A9B8BC; padding: 3rem 0; font-size: .95rem; }
.footer-inner { display: grid; grid-template-columns: 1.3fr 2fr auto; gap: 2rem; align-items: start; }
.logo-small { font-size: 1.15rem; color: var(--paper); margin-bottom: .5rem; }
.logo-small:hover { color: var(--paper); }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; }
.footer-links a, .site-footer a { color: #D5E0E2; text-decoration: none; }
.footer-links a:hover { color: var(--signal); }
.copyright { margin: 0; }

/* Grid children may shrink below their content width (prevents overflow) */
.hero-grid > *, .two-col > *, .faq-wrap > *, .contact-grid > *, .policy-inner > * { min-width: 0; }

/* Responsive */
@media (max-width: 980px) {
  .hero-grid, .two-col, .faq-wrap, .contact-grid, .policy-inner { grid-template-columns: 1fr; }
  .included-grid { grid-template-columns: 1fr 1fr; }
  .included-grid article, .included-grid article:not(:nth-child(3n+1)) { padding: 1.5rem 1.5rem 1.5rem 0; border-left: 0; }
  .included-grid article:nth-child(even) { padding-left: 1.5rem; border-left: 1px solid #34505C; }
  .steps { grid-template-columns: 1fr 1fr; gap: 2.5rem 0; }
  .steps li:nth-child(2)::after { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  nav ul {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter) 1rem;
  }
  nav ul.open { display: flex; }
  nav li a { display: block; padding: .8rem 0; }
  nav .nav-cta { text-align: center; margin-top: .5rem; padding: .8rem; }
}
@media (max-width: 600px) {
  .included-grid { grid-template-columns: 1fr; }
  .included-grid article:nth-child(even) { padding-left: 0; border-left: 0; }
  .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .quote-form { grid-template-columns: 1fr; }
  .bits { grid-template-columns: 1fr 1fr; gap: .9rem; }
  .octet { gap: 3px; }
  .bit { font-size: .7rem; }
  .readout dd { font-size: 1.3rem; }
  .hero-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
