/* ==========================================================================
   Topoli Software — styles
   Calm, precise, system-native. One accent. Type does the work.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Surfaces */
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --tile: #ffffff; /* card sitting on --bg-alt */
  --tile-on-bg: #f5f5f7; /* card sitting on --bg */
  --hairline: rgba(0, 0, 0, 0.1);
  --chrome: rgba(255, 255, 255, 0.72);

  /* Text */
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;

  /* Accent */
  --accent: #0066cc;
  --accent-tint: rgba(0, 113, 227, 0.1);
  --button: #0071e3;
  --button-hover: #0077ed;
  --button-active: #006edb;
  --button-text: #ffffff;

  /* Contact card (inverted) */
  --inv-bg: #1d1d1f;
  --inv-text: #f5f5f7;
  --inv-text-2: #a1a1a6;
  --inv-hairline: rgba(255, 255, 255, 0.16);

  /* Build window (always dark — it is the "product shot") */
  --term-bg: #1e1e1e;
  --term-bar: #2b2b2c;
  --term-text: #cccccc;
  --term-dim: #6a6a6a;
  --term-path: #9cdcfe;
  --term-ok: #6ccb5f;

  /* Shape & depth */
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-window: 0 2px 4px rgba(0, 0, 0, 0.04), 0 18px 36px -12px rgba(0, 0, 0, 0.18),
    0 48px 80px -32px rgba(0, 0, 0, 0.28);

  /* Layout */
  --max: 68rem;
  --gutter: clamp(1rem, 5vw, 2.5rem);
  --section-space: clamp(4.5rem, 10vw, 8.5rem);

  /* Type */
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
    "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI Variable Display", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Cascadia Code", Consolas,
    "Liberation Mono", monospace;

  /* Motion — critically damped feel, no overshoot */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #0d0d0e;
    --tile: #1c1c1e;
    --tile-on-bg: #161617;
    --hairline: rgba(255, 255, 255, 0.12);
    --chrome: rgba(22, 22, 23, 0.72);

    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;

    --accent: #2997ff;
    --accent-tint: rgba(41, 151, 255, 0.16);
    --button: #0071e3;
    --button-hover: #0077ed;
    --button-active: #006edb;

    --inv-bg: #1c1c1e;
    --inv-hairline: rgba(255, 255, 255, 0.14);

    --term-bg: #161617;
    --term-bar: #232325;

    --shadow-window: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.5;
  font-optical-sizing: auto;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

[id] {
  scroll-margin-top: 4rem;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

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

.container {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.9375rem;
}

.skip:focus {
  top: 0.75rem;
}

/* --------------------------------------------------------------------------
   Type scale — tracking tightens as size grows; leading loosens as it shrinks
   -------------------------------------------------------------------------- */

.eyebrow {
  margin-bottom: 0.75rem;
  color: var(--text-2);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.005em;
}

.display {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.55rem + 4.2vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.4rem + 2.8vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.headline .quiet {
  display: block;
  color: var(--text-3);
}

h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3125rem, 1.2rem + 0.4vw, 1.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
}

p {
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Buttons — feedback on press, not on release
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0.75rem 1.375rem;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 160ms ease, transform 120ms ease-out;
}

.button:hover {
  background: var(--button-hover);
  text-decoration: none;
}

.button:active {
  background: var(--button-active);
  transform: scale(0.97);
  transition-duration: 60ms;
}

.button--small {
  min-height: 2rem;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  font-size: 1.0625rem;
  font-weight: 500;
}

.link-more::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.2em;
  border-right: 1.75px solid currentColor;
  border-bottom: 1.75px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 200ms var(--ease-out);
}

.link-more:hover::after {
  transform: translateX(3px) rotate(-45deg);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
}

/* --------------------------------------------------------------------------
   Header — translucent material, content scrolls beneath
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow 200ms ease;
}

.site-header[data-scrolled] {
  box-shadow: 0 1px 0 var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: calc(var(--max) + 2 * var(--gutter));
  height: 3.25rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.wordmark {
  margin-right: auto;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.wordmark:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.75rem;
}

.nav a {
  color: var(--text-2);
  font-size: 0.875rem;
  letter-spacing: 0.005em;
  transition: color 160ms ease;
}

.nav a:hover,
.nav a[aria-current] {
  color: var(--text);
  text-decoration: none;
}

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

.hero {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: var(--section-space);
  text-align: center;
  overflow: hidden;
}

.hero .display {
  max-width: 15em;
  margin-inline: auto;
}

.hero .lede {
  max-width: 38rem;
  margin: 1.5rem auto 0;
  color: var(--text-2);
  font-size: clamp(1.1875rem, 1.05rem + 0.55vw, 1.4375rem);
  line-height: 1.42;
  letter-spacing: -0.012em;
}

.hero .actions {
  justify-content: center;
  margin-top: 2.25rem;
}

/* Build window — the "product shot" */

.build {
  max-width: 52rem;
  margin: clamp(2.75rem, 6vw, 4rem) auto 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--term-bg);
  box-shadow: var(--shadow-window);
  text-align: left;
  animation: window-in 900ms var(--ease-out) 150ms both;
}

/* With JS, the log "builds" once the window is properly in view. Without JS it is simply shown. */
.js .build .l {
  opacity: 0;
}

.js .build.is-in .l {
  animation: line-in 260ms ease-out both;
  animation-delay: calc(400ms + var(--i) * 110ms);
}

.build-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 2.5rem;
  padding: 0 0.5rem 0 1rem;
  background: var(--term-bar);
  color: #a8a8a8;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.build-title {
  color: #e6e6e6;
  font-weight: 600;
}

.build-source {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.caption-buttons {
  flex: none;
  width: 7.5rem;
  height: 1rem;
  margin-left: auto;
  fill: none;
  stroke: #9a9a9a;
  stroke-width: 1.1;
}

.build-log {
  margin: 0;
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.75rem) clamp(1.25rem, 3.5vw, 1.75rem);
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: clamp(0.6875rem, 0.6rem + 0.4vw, 0.875rem);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.build-log .dim {
  color: var(--term-dim);
}

.build-log .path {
  color: var(--term-path);
}

.build-log .ok {
  color: var(--term-ok);
}

.build-log .ok b {
  font-weight: 700;
}

@keyframes window-in {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes line-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.section {
  padding-block: var(--section-space);
}

.section--alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 56rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-sub {
  margin-top: 1.25rem;
  color: var(--text-2);
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

/* What we work on — bento */

.bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.875rem, 2vw, 1.25rem);
}

.tile {
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius-lg);
  background: var(--tile);
}

.tile--wide {
  grid-column: 1 / -1;
}

.tile-sub {
  margin-top: 0.5rem;
  color: var(--text-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1.75rem;
}

.chips li {
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--bg-alt);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.list {
  display: grid;
  gap: 0.875rem;
  margin-top: 1.5rem;
}

.list li {
  position: relative;
  padding-left: 2rem;
  line-height: 1.4;
}

.list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
}

.list li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.25rem;
  height: 1.25rem;
  -webkit-mask: var(--glyph) center / 0.8rem no-repeat;
  mask: var(--glyph) center / 0.8rem no-repeat;
}

.list--yes li::before {
  background: var(--accent-tint);
}

.list--yes li::after {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
  background: var(--accent);
}

.list--no li {
  color: var(--text-2);
}

.list--no li::before {
  background: var(--hairline);
}

.list--no li::after {
  --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 8h8'/%3E%3C/svg%3E");
  background: var(--text-2);
}

/* Services */

.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.875rem, 2vw, 1.25rem);
}

.service {
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: var(--radius-lg);
  background: var(--tile-on-bg);
}

.service-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1.5rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-lede {
  margin-top: 0.625rem;
  color: var(--text-2);
  font-size: 1.125rem;
  line-height: 1.45;
}

.spec {
  margin-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}

.spec li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--hairline);
  line-height: 1.4;
}

.spec li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* How we work */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.875rem, 2vw, 1.25rem);
  counter-reset: step;
}

.step {
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  border-radius: var(--radius-md);
  background: var(--tile);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

.step p {
  margin-top: 0.5rem;
  color: var(--text-2);
  line-height: 1.45;
}

/* Contact */

.contact {
  padding-top: clamp(1rem, 3vw, 2rem);
}

.contact .container {
  max-width: calc(var(--max) + 2 * var(--gutter));
}

.contact-card {
  padding: clamp(2.75rem, 8vw, 6rem) clamp(1.5rem, 6vw, 5rem);
  border-radius: var(--radius-lg);
  background: var(--inv-bg);
  color: var(--inv-text);
  text-align: center;
}

.contact-card .eyebrow {
  color: var(--inv-text-2);
}

.contact-card .headline {
  max-width: 14em;
  margin-inline: auto;
}

.contact-copy {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  color: var(--inv-text-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.5;
}

.email {
  margin-top: clamp(2rem, 5vw, 3rem);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1rem + 2.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.email a {
  color: var(--inv-text);
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 2px;
  transition: background-size 350ms var(--ease-out);
}

.email a:hover {
  text-decoration: none;
  background-size: 100% 2px;
}

.contact-card .actions {
  justify-content: center;
  margin-top: 2rem;
}

.button--light {
  background: var(--inv-text);
  color: var(--inv-bg);
}

.button--light:hover {
  background: #ffffff;
}

.button--light:active {
  background: #e8e8ed;
}

.button--ghost {
  background: transparent;
  color: var(--inv-text);
  box-shadow: inset 0 0 0 1px var(--inv-hairline);
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.button--ghost:active {
  background: rgba(255, 255, 255, 0.14);
}

.copy-icon {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-icon .check-glyph {
  opacity: 0;
  stroke-width: 1.9;
}

.copy-icon g,
.copy-icon path {
  transition: opacity 160ms ease;
}

.button--ghost[data-state="copied"] {
  color: var(--term-ok);
}

.button--ghost[data-state="copied"] .copy-glyph {
  opacity: 0;
}

.button--ghost[data-state="copied"] .check-glyph {
  opacity: 1;
}

.contact-card :focus-visible {
  outline-color: var(--inv-text);
}

/* Footer */

.site-footer {
  padding: 2.5rem 0 3rem;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.site-footer strong {
  color: var(--text);
  font-weight: 600;
}

.site-footer .sep {
  margin: 0 0.25rem;
}

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

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .step {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    align-items: start;
  }

  .step-num {
    grid-row: span 2;
    margin-bottom: 0;
  }

  .step p {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .nav {
    display: none;
  }

  .bento,
  .services {
    grid-template-columns: 1fr;
  }

  .build-source {
    display: none;
  }

  .caption-buttons {
    width: 5.5rem;
  }
}

@media (max-width: 420px) {
  .hero .actions {
    flex-direction: column;
    gap: 1.25rem;
  }

  .contact-card .actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   Accessibility preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .build {
    animation: fade-in 300ms ease both;
  }

  .js .build .l,
  .js .build.is-in .l {
    opacity: 1;
    animation: none;
  }

  .button:active {
    transform: none;
  }

  .link-more::after,
  .email a {
    transition: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --text-2: var(--text);
    --text-3: var(--text);
    --hairline: currentColor;
  }

  .site-header {
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 1px 0 var(--text);
  }

  .tile,
  .service,
  .step {
    outline: 1px solid var(--text);
  }
}

@media print {
  .site-header,
  .skip,
  .build,
  .contact-card .actions {
    display: none;
  }

  .section--alt,
  .contact-card {
    background: none;
    color: #000;
  }
}
