/* Chilli Dev - "Graphite & Ember" theme. Light, brand colors from the logo, Saira + Rubik. */

:root {
  --graphite: #303F42;
  --dev: #EF4216;
  --chili-1: #F3711E;
  --chili-2: #EA541C;
  --chili-3: #D7311D;
  --chili-4: #B01E29;

  /* Accessible variants (WCAG AA for small text / focus) */
  --btn-bg: #D7311D;
  --btn-bg-hover: #B01E29;
  --kicker: #C8361A;
  --kicker-on-dark: #FF9A5C;
  --focus-on-dark: #FF9A5C;

  --bg: #FAFBFB;
  --surface: #FFFFFF;
  --fg: #1F2A2C;
  --muted: #5C6A6D;
  --line: #E3E8E8;
  --soft: #EEF2F2;
  --on-dark: #E8EEEE;
  --on-dark-muted: #B4C2C4;

  --f-display: "Saira", "Rubik", system-ui, sans-serif;
  --f-body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 16px;
  --gutter: clamp(18px, 4vw, 48px);
  --section-gap: clamp(64px, 9vw, 112px);
  --nav-h: 72px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a { color: inherit; }

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

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--graphite);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- Wordmark ---------- */

.wm {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  text-decoration: none;
  color: var(--graphite);
  font-size: 17px;
}

.wm svg { width: 1.8em; height: 1.8em; flex: none; }

.wm-t {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "wdth" 115;
  font-stretch: 115%;
  letter-spacing: -0.055em;
  font-size: 1.4em;
  line-height: 1;
}

.wm-t b { font-weight: 600; color: var(--dev); }

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 251, 251, 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.nav.is-scrolled { border-bottom-color: var(--line); }

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--nav-h);
}

.nav__links {
  display: flex;
  gap: 26px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  font-size: 15px;
}

.nav__links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.nav__links a:hover { color: var(--fg); }

.lang-switch {
  display: inline-flex;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.lang-switch a {
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--muted);
  text-decoration: none;
}

.lang-switch a:hover { color: var(--fg); background: var(--soft); }

.lang-switch a[aria-current="true"] {
  background: var(--graphite);
  color: #fff;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--btn-bg);
  color: #fff;
  text-decoration: none;
  font: 500 15px/1 var(--f-body);
  padding: 14px 20px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover { background: var(--btn-bg-hover); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--fg);
  box-shadow: inset 0 0 0 1.5px var(--line);
}

.btn--ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--graphite); }

.btn--small { padding: 11px 16px; font-size: 14px; }

.btn .arrow { transition: transform 0.15s; }
.btn:hover .arrow { transform: translateX(3px); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  align-items: center;
  padding-block: clamp(24px, 3.5vw, 48px) clamp(32px, 4vw, 56px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 22px;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--dev);
  flex: none;
}

.hero h1 {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 112;
  font-stretch: 112%;
  font-weight: 650;
  font-size: clamp(32px, 5.6vw, 74px);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 26px;
  text-wrap: balance;
}

.hero h1 em { font-style: normal; color: var(--dev); }

.hero__lead {
  font-size: clamp(17px, 1.5vw, 19px);
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 34px;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__art {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  justify-self: center;
}

.hero__ring {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle at 60% 38%, #fff 0, var(--soft) 72%);
  box-shadow: inset 0 0 0 1px var(--line);
}

.hero__icon {
  position: absolute;
  inset: 14%;
  width: 72%;
  height: 72%;
  filter: drop-shadow(0 30px 40px rgba(176, 30, 41, 0.22));
}

.hero__px {
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--chili-1);
}

.hero__px:nth-of-type(1) { left: 6%; top: 22%; }
.hero__px:nth-of-type(2) { right: 6%; top: 12%; width: 14px; height: 14px; background: var(--chili-3); }
.hero__px:nth-of-type(3) { right: 14%; bottom: 10%; width: 18px; height: 18px; background: var(--chili-2); }

@media (prefers-reduced-motion: no-preference) {
  .hero__icon { animation: float 7s ease-in-out infinite; }
  .hero__px { animation: drift 6s ease-in-out infinite; }
  .hero__px:nth-of-type(2) { animation-delay: -2s; }
  .hero__px:nth-of-type(3) { animation-delay: -4s; }
}

@keyframes float { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
@keyframes drift { 50% { transform: translate(6px, -8px); } }

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

.section { padding-top: var(--section-gap); }
.hero + .section { padding-top: clamp(32px, 4vw, 56px); }

.section__head {
  display: grid;
  gap: 12px;
  margin-bottom: 40px;
  max-width: 720px;
}

.section__kicker {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kicker);
  font-weight: 500;
  margin: 0;
}

.section__title {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 110;
  font-stretch: 110%;
  font-weight: 650;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

.section__intro { margin: 0; color: var(--muted); font-size: 17px; max-width: 60ch; }

/* ---------- Service cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  box-shadow: 0 24px 40px -24px rgba(48, 63, 66, 0.35);
}

.card__mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--chili-1), var(--chili-3));
  clip-path: polygon(0 30%, 55% 0, 100% 45%, 70% 100%, 10% 85%);
}

.card:nth-child(2) .card__mark { background: linear-gradient(135deg, var(--chili-2), var(--chili-4)); clip-path: polygon(20% 0, 100% 20%, 85% 100%, 0 70%); }
.card:nth-child(3) .card__mark { background: linear-gradient(135deg, var(--chili-1), var(--chili-2)); clip-path: polygon(50% 0, 100% 60%, 70% 100%, 0 80%, 10% 25%); }
.card:nth-child(4) .card__mark { background: linear-gradient(135deg, var(--chili-3), var(--chili-4)); clip-path: polygon(0 0, 100% 15%, 80% 85%, 25% 100%); }

.card h3 {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 110;
  font-stretch: 110%;
  font-weight: 650;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 6px 0 0;
}

.card p { margin: 0; color: var(--muted); font-size: 15px; }

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: auto 0 0;
  padding: 8px 0 0;
}

.card__tags li {
  font-size: 12px;
  background: var(--soft);
  color: var(--graphite);
  padding: 4px 9px;
  border-radius: 6px;
}

/* ---------- Process steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  border-top: 1px solid var(--line);
}

.step {
  position: relative;
  padding: 28px 24px 8px 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.step + .step { padding-left: 24px; border-left: 1px solid var(--line); }

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--f-display);
  font-variation-settings: "wdth" 115;
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--graphite);
}

.step::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--dev);
}

.step + .step::after { left: 24px; }

.step h3 { margin: 6px 0 0; font-size: 18px; font-weight: 500; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Technology cloud ---------- */

.cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 12px;
  list-style: none;
  margin: 0;
  padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 56px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
}

.tag {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 108;
  font-stretch: 108%;
  line-height: 1.1;
  letter-spacing: -0.01em;
  padding: 0.38em 0.75em;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--graphite);
  background: var(--bg);
  white-space: nowrap;
  transition: transform 0.2s, border-color 0.2s, color 0.2s, background 0.2s;
}

.tag:hover { transform: translateY(-2px); border-color: var(--dev); color: var(--kicker); }

.tag--xl { font-size: clamp(20px, 2.4vw, 28px); font-weight: 650; background: var(--soft); border-color: transparent; }
.tag--l { font-size: clamp(17px, 1.8vw, 21px); font-weight: 600; }
.tag--m { font-size: 15px; font-weight: 500; }
.tag--s { font-size: 13px; font-weight: 500; color: var(--muted); }

.tag--xl:nth-child(8n+6) { background: var(--graphite); color: #fff; }
.tag--xl:nth-child(8n+2) { background: var(--btn-bg); color: #fff; }

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

.contact {
  margin-top: var(--section-gap);
  background: var(--graphite);
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
}

.contact::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  right: -180px;
  top: -220px;
  background: radial-gradient(circle, rgba(239, 66, 22, 0.32), transparent 65%);
  pointer-events: none;
}

.contact .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: end;
  padding-block: clamp(56px, 8vw, 96px);
}

.contact .section__kicker { color: var(--kicker-on-dark); }
.contact :focus-visible { outline-color: var(--focus-on-dark); }
.contact .section__title { color: #fff; }
.contact .section__intro { color: var(--on-dark-muted); margin-top: 12px; }

.contact__list {
  display: grid;
  gap: 18px;
  justify-items: start;
  min-width: 0;
}

.contact__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  margin-bottom: 4px;
}

.contact__value {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 110;
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 38px);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--dev), var(--dev));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.25s;
}

.contact__value:hover { background-size: 100% 2px; }

.contact__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

.copy-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--on-dark);
  font: 500 13px/1 var(--f-body);
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.copy-btn:hover { border-color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.06); }
.copy-btn.is-done { border-color: var(--chili-1); color: #fff; }

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

.footer {
  background: var(--graphite);
  color: var(--on-dark-muted);
  font-size: 14px;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 24px max(24px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer .wm { color: var(--on-dark); font-size: 14px; }
.footer p { margin: 0; }

/* ---------- 404 ---------- */

.notfound {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 20px;
  padding-block: 64px;
}

.notfound h1 {
  font-family: var(--f-display);
  font-variation-settings: "wdth" 115;
  font-weight: 700;
  font-size: clamp(72px, 14vw, 160px);
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin: 0;
  color: var(--dev);
}

.notfound p { margin: 0; color: var(--muted); font-size: 18px; }

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

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(3) { padding-left: 0; border-left: 0; }
  .step:nth-child(3)::after { left: 0; }
  .contact .wrap { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 820px) {
  :root { --nav-h: 64px; }
  .nav__links { display: none; }
  .nav .wrap { gap: 14px; }
  .nav .lang-switch { margin-left: auto; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero h1 { overflow-wrap: break-word; hyphens: auto; }
  .hero { text-align: center; }
  .hero__art { max-width: 300px; grid-row: 1; justify-self: center; }
  .hero__lead { margin-inline: auto; }
  .hero__cta { justify-content: center; }
}

@media (max-width: 560px) {
  .cards,
  .steps { grid-template-columns: 1fr; }
  .step,
  .step + .step { padding-left: 0; border-left: 0; }
  .step + .step::after { left: 0; }
  /* The CTA drops to its own centered row below the bar; anchors must clear it. */
  html { scroll-padding-top: calc(var(--nav-h) + 64px); }
  .nav .wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: var(--nav-h) auto;
    align-items: center;
    gap: 0 14px;
    padding-bottom: 12px;
  }
  .nav .wrap > nav { display: none; }
  .nav__cta { grid-column: 1 / -1; justify-self: center; }
  .hero__art { max-width: 220px; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hero__icon { color: var(--graphite); }
.nav .wrap > nav { margin-left: auto; }
.nav__links { margin-left: 0; }
