:root {
  --bg: #05070d;
  --fg: #e6e9ef;
  --muted: #8a93a6;
  --line: #c9d0dc;
  --accent: #e0a458;
  --hair: rgba(201, 208, 220, 0.14);
  --panel: rgba(13, 20, 34, 0.55);
  --pad: clamp(20px, 5vw, 56px);
  --max: 1160px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, #0d1422 0%, var(--bg) 70%) fixed;
  color: var(--fg);
  font-family: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* CJK: Latin text keeps the Latin face, everything else falls back to a native one */
html:lang(zh) body {
  font-family: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}
/* Traditional characters need Traditional fonts: the shapes of many characters differ */
html:lang(zh-Hant) body {
  font-family: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, "PingFang TC", "Microsoft JhengHei",
    "Noto Sans TC", "Noto Sans CJK TC", "Source Han Sans TC", sans-serif;
}
html:lang(ja) body {
  font-family: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Noto Sans CJK JP", Meiryo, "Yu Gothic", sans-serif;
}
html:lang(ko) body {
  font-family: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, "Apple SD Gothic Neo", "Noto Sans KR",
    "Noto Sans CJK KR", "Malgun Gothic", sans-serif;
  word-break: keep-all;
}
html:lang(zh) body, html:lang(ja) body { line-break: strict; }
html:lang(ar) body {
  font-family: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, "SF Arabic", "Geeza Pro", "Noto Sans Arabic",
    "Noto Naskh Arabic", Tahoma, sans-serif;
}
html:lang(ja) :is(h1, h2, h3, .form-status, .form-done p) { word-break: auto-phrase; }

/* Until the chosen translation is applied (see i18n.js); reveals itself anyway if main.js never runs */
.i18n-pending body {
  visibility: hidden;
  animation: i18n-fallback 0s 3s forwards;
}

@keyframes i18n-fallback { to { visibility: visible; } }

a { color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

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

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

main, .topbar, .footer { position: relative; z-index: 1; }

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px var(--pad);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}

.topbar.scrolled {
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--hair);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-decoration: none;
}

.brand-mark {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.brand-mark::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.nav {
  display: flex;
  gap: 28px;
  margin-inline-start: auto;
}

.nav a {
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.nav a:hover, .nav a:focus-visible { color: var(--fg); }

/* Language menu */

.lang { position: relative; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  letter-spacing: 0.14em;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding-block: 6px;
  padding-inline: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.lang-btn:hover, .lang-btn:focus-visible, .lang-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-caret {
  width: 10px;
  height: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s;
}

.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }

.lang-globe {
  flex: none;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 20;
  min-width: 232px;
  list-style: none;
  padding: 6px;
  background: #0a0e18;
  border: 1px solid var(--hair);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  letter-spacing: normal;
  text-transform: none;
  text-align: start;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.lang-option:hover, .lang-option:focus-visible {
  background: rgba(201, 208, 220, 0.08);
  outline: none;
}

.lang-option[aria-current="true"] { color: var(--accent); }

.lang-option[aria-current="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-start: auto;
  border-radius: 50%;
  background: var(--accent);
}


/* Shared */

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

h1, h2 {
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

h1, h2, h3 { text-wrap: balance; }

h1 {
  font-size: clamp(38px, 6vw, 68px);
  margin-bottom: 24px;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

h2 { font-size: clamp(30px, 4.2vw, 46px); }

h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 10px;
}

p { color: var(--muted); text-wrap: pretty; }

p strong { color: var(--fg); font-weight: 500; }

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(72px, 11vw, 128px) var(--pad) 0;
}

.section-head { max-width: 680px; margin-bottom: 48px; }

.section-lead {
  margin-top: 18px;
  font-size: clamp(15px, 1.6vw, 17px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

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

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.btn-primary:hover { background: #ebb877; }

.btn-ghost {
  border: 1px solid var(--hair);
  color: var(--fg);
}

.btn-ghost:hover { border-color: var(--line); }

.icon {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hero */

.hero {
  max-width: var(--max);
  margin: 0 auto;
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  padding: 32px var(--pad) 64px;
}

.lead {
  max-width: 34em;
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero-art {
  display: flex;
  justify-content: center;
}

/* Full-cycle diagram: six stages around a ring, Net/Sys/Dev/Sec Ops in the middle */

.cycle {
  position: relative;
  width: min(460px, 100%);
  aspect-ratio: 1;
  container-type: inline-size;
}

.cycle-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
}

.cycle-ring * { vector-effect: non-scaling-stroke; }

.cycle-track { stroke: rgba(201, 208, 220, 0.3); stroke-width: 1; }

.cycle-inner { stroke: var(--hair); stroke-width: 1; }

.cycle-arrow {
  stroke: var(--line);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.6;
}

.cycle-steps { list-style: none; }

.cycle-steps li {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding-block: 0.6em;
  padding-inline: 0.85em 1.1em;
  font-size: clamp(9px, 2.6cqi, 12px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
  background: #070a12;
  border: 1px solid var(--hair);
  border-radius: 999px;
  animation: cycle-step 12s infinite;
  animation-delay: var(--delay);
}

.cycle-steps li::before {
  content: "";
  flex: none;
  width: 0.75em;
  height: 0.75em;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  animation: cycle-dot 12s infinite;
  animation-delay: var(--delay);
}

/* Clockwise from the top left, 35% from the centre */
.cycle-steps li:nth-child(1) { left: 19.69%; top: 32.5%; --delay: 0s; }
.cycle-steps li:nth-child(2) { left: 50%;    top: 15%;   --delay: 2s; }
.cycle-steps li:nth-child(3) { left: 80.31%; top: 32.5%; --delay: 4s; }
.cycle-steps li:nth-child(4) { left: 80.31%; top: 67.5%; --delay: 6s; }
.cycle-steps li:nth-child(5) { left: 50%;    top: 85%;   --delay: 8s; }
.cycle-steps li:nth-child(6) { left: 19.69%; top: 67.5%; --delay: 10s; }

@keyframes cycle-step {
  0%, 26%, 100% { color: var(--muted); border-color: var(--hair); }
  4%, 18%       { color: var(--fg); border-color: rgba(224, 164, 88, 0.55); }
}

@keyframes cycle-dot {
  0%, 26%, 100% { background: var(--bg); border-color: var(--line); box-shadow: none; }
  4%, 18%       { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 0.35em rgba(224, 164, 88, 0.18); }
}

.cycle-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  font-size: 5.4cqi;
  font-weight: 300;
  line-height: 1.12;
  color: var(--fg);
}

.core-prefix {
  display: grid;
  justify-items: end;
  padding-right: 0.35em;
  border-right: 1px solid rgba(201, 208, 220, 0.35);
}

.core-ops {
  padding-left: 0.2em;
  font-size: 2em;
  font-weight: 200;
  color: var(--accent);
}

/* Stats */

.stats {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  padding: 28px 24px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.stat + .stat { border-inline-start: 1px solid var(--hair); }

.stat-value {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 200;
  line-height: 1;
  color: var(--fg);
  margin-bottom: 10px;
}

.stat-label {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* About */

.about {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
}

.about .section-head { margin-bottom: 0; }

.about-body p {
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.75;
}

.about-body p + p { margin-top: 20px; }

/* Services */

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

.card {
  padding: 32px 28px;
  background: var(--panel);
  border: 1px solid var(--hair);
  border-radius: 16px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: border-color 0.3s, transform 0.3s;
}

.card:hover {
  border-color: rgba(224, 164, 88, 0.45);
  transform: translateY(-3px);
}

.card .icon { margin-bottom: 22px; }

.card p { font-size: 15px; }

/* Ops disciplines */

.ops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}

.op { padding: 32px 26px 36px; }

.op + .op { border-inline-start: 1px solid var(--hair); }

.op-name {
  font-size: clamp(32px, 3.4vw, 42px);
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.op-name span { color: var(--accent); }

.op-sub {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 12px;
}

.op p { font-size: 15px; }

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tags li {
  padding: 4px 11px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  border: 1px solid var(--hair);
  border-radius: 999px;
}

/* Process */

.sequence {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  position: relative;
}

.sequence::before {
  content: "";
  position: absolute;
  top: 7px;
  inset-inline: 0;
  border-top: 1px dashed rgba(201, 208, 220, 0.25);
}

.step {
  position: relative;
  padding-top: 36px;
}

.step::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--line);
}

.step-live::before {
  background: var(--accent);
  border-color: var(--accent);
  animation: pulse 2.4s ease-out infinite;
}

.step-t {
  display: block;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.step p { font-size: 15px; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224, 164, 88, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(224, 164, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 164, 88, 0); }
}

/* Principles */

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

.principle {
  border-top: 1px solid var(--hair);
  padding-top: 24px;
}

.principle-n {
  display: block;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 14px;
}

.principle h3 { font-size: 22px; font-weight: 400; }

/* Contact */

.contact { padding-bottom: clamp(72px, 11vw, 128px); }

.contact-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "intro map" "contacts contacts" "form form";
  gap: 40px clamp(36px, 5vw, 72px);
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--hair);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 70% 90% at 15% 0%, rgba(224, 164, 88, 0.1), transparent 70%),
    var(--panel);
}

.contact-intro { grid-area: intro; }

.contact-intro .section-lead { max-width: 30em; }

/* What happens after the visitor writes to us */
.contact-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.contact-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.contact-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  background: rgba(224, 164, 88, 0.14);
}

/* Email, office, and social media in one row under the intro and the map */
.contacts {
  grid-area: contacts;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px 48px;
  padding-top: 32px;
  border-top: 1px solid var(--hair);
}

.contacts dt {
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.contacts dd a {
  font-size: 20px;
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s;
}

.contacts dd a:hover { color: var(--accent); }

.contacts address {
  font-size: 15px;
  font-style: normal;
  line-height: 1.7;
  color: var(--fg);
}

.contacts address strong { font-weight: 500; }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.contacts .social a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.social svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.map-link {
  display: inline-block;
  margin-top: 10px;
}

.contacts dd .map-link { font-size: 14px; color: var(--muted); }

.map-link::after { content: " \2197"; }
[dir="rtl"] .map-link::after { content: " \2196"; }

/* Map: as tall as the intro next to it. The image is positioned absolutely so its own proportions
   never stretch the row; object-fit crops the edges and keeps the pin in the middle */

.contact-map {
  grid-area: map;
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: #0b1019;
}

.map-open,
.map-open img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.map-open img { object-fit: cover; }

/* OpenStreetMap data requires a visible credit */
.map-credit {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(11, 16, 25, 0.75);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}

.map-credit:hover { color: var(--fg); }

/* Contact form: its own row under the contacts, behind the same kind of rule */

.contact-form-wrap {
  grid-area: form;
  padding-top: 32px;
  border-top: 1px solid var(--hair);
}

.contact-form {
  position: relative;
  display: grid;
  gap: 18px;
}

.contact-form[hidden], .form-done[hidden] { display: none; }

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

.field { display: grid; gap: 8px; }

.field label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-opt {
  margin-inline-start: 0.4em;
  letter-spacing: normal;
  text-transform: none;
  opacity: 0.75;
}

.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
  background: rgba(5, 7, 13, 0.55);
  border: 1px solid rgba(201, 208, 220, 0.2);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field textarea { min-height: 168px; resize: vertical; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(224, 164, 88, 0.65);
  box-shadow: 0 0 0 3px rgba(224, 164, 88, 0.15);
}

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--fg);
  caret-color: var(--fg);
  box-shadow: 0 0 0 100px #0b101b inset;
}

.contact-form [aria-invalid="true"] { border-color: #e9967a; }

/* Honeypot: off-screen rather than display:none, which some bots skip */
.hp {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.consent input[aria-invalid="true"] { outline: 2px solid #e9967a; outline-offset: 2px; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.form-actions .btn {
  font-family: inherit;
  border: 0;
  cursor: pointer;
}

.form-actions .btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

.form-status { flex: 1 1 220px; font-size: 14px; }

.form-status:empty { display: none; }

.contact-form:is([data-state="error"], [data-state="invalid"]) .form-status { color: #f0a58c; }

/* The thank-you note that replaces the sent form */
.form-done {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid rgba(111, 207, 151, 0.3);
  border-radius: 16px;
  background: rgba(111, 207, 151, 0.07);
  animation: form-done 0.5s ease;
}

.form-done:focus { outline: none; }

.form-done svg {
  flex: none;
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #6fcf97;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.form-done p { font-size: clamp(16px, 1.7vw, 18px); color: var(--fg); }

@keyframes form-done {
  from { opacity: 0; transform: translateY(8px); }
}

.consent a, .form-status a, .privacy a {
  color: var(--fg);
  text-decoration-color: rgba(224, 164, 88, 0.6);
  text-underline-offset: 3px;
}

.consent a:hover, .form-status a:hover, .privacy a:hover { color: var(--accent); }

/* Footer */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px var(--pad);
  border-top: 1px solid var(--hair);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-link {
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover, .footer-link:focus-visible { color: var(--accent); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6fcf97;
  box-shadow: 0 0 8px rgba(111, 207, 151, 0.7);
}

/* Privacy policy dialog */

html:has(.privacy[open]) { overflow: hidden; }

.privacy {
  width: min(800px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  color: var(--fg);
  background: #0a0e18;
  border: 1px solid var(--hair);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.privacy[open] { animation: dialog-in 0.2s ease-out; }

.privacy::backdrop {
  background: rgba(2, 3, 6, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px); }
}

.privacy-body {
  max-height: min(90vh, 900px);
  overflow-y: auto;
  padding: clamp(28px, 5vw, 44px);
}

.privacy h2 {
  margin: 0 0 8px;
  margin-inline-end: 48px;
  font-size: clamp(26px, 3.4vw, 34px);
}

.privacy-updated {
  margin-bottom: 22px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.privacy p:not(.privacy-updated) { font-size: 15px; line-height: 1.7; }

.privacy p + p:not(.privacy-updated) { margin-top: 14px; }

.privacy-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: #0a0e18;
  border: 1px solid var(--hair);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.privacy-close:hover, .privacy-close:focus-visible {
  outline: none;
  color: var(--accent);
  border-color: var(--accent);
}

.privacy-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* 404 page: one centered column between the top bar and the footer */

body:has(.notfound) {
  display: flex;
  flex-direction: column;
}

.notfound {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 32px var(--pad) 88px;
  text-align: center;
}

.nf-art {
  width: min(340px, 80%);
  margin-bottom: 44px;
  overflow: visible;
}

.nf-art * { vector-effect: non-scaling-stroke; }

.nf-digit {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nf-dot { fill: var(--accent); }

.nf-pulse {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
  animation: nf-pulse 2.4s ease-out infinite;
}

@keyframes nf-pulse {
  from { opacity: 0.5; transform: scale(1); }
  to   { opacity: 0; transform: scale(2.4); }
}

.notfound .lead { margin: 0 auto; }

.notfound .actions { justify-content: center; }

/* The failed request as a log line: GET /path 404 Not Found */
.nf-request {
  margin-top: 28px;
  padding: 6px 16px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.nf-path { color: var(--fg); }

.nf-status { color: var(--accent); }

/* Scroll reveal (enabled by JS) */

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.js .reveal.visible {
  opacity: 1;
  transform: none;
}

/* CJK: wide tracking and tight leading are tuned for Latin */

html:is(:lang(zh), :lang(ja), :lang(ko)) :is(.topbar, .eyebrow, .btn, .stat-label, .cycle-steps li,
  .op-sub, .step-t, .contacts dt, .field label, .privacy-updated, .footer) {
  letter-spacing: 0.08em;
}
html:is(:lang(zh), :lang(ja)) .field-opt { margin-inline-start: 0; }  /* full-width brackets bring their own space */
html:is(:lang(zh), :lang(ja), :lang(ko)) h1 { font-size: clamp(34px, 5.2vw, 60px); line-height: 1.25; }
html:is(:lang(zh), :lang(ja), :lang(ko)) h2 { line-height: 1.3; }
html:is(:lang(zh), :lang(ja), :lang(ko)) p { line-height: 1.85; }

/* Right-to-left (Arabic): mirror what logical properties can't */

[dir="rtl"] .cycle-ring { transform: scaleX(-1); }  /* arrows run counterclockwise, with the reading order */
[dir="rtl"] .cycle-steps li:nth-child(1),
[dir="rtl"] .cycle-steps li:nth-child(6) { left: 80.31%; }
[dir="rtl"] .cycle-steps li:nth-child(3),
[dir="rtl"] .cycle-steps li:nth-child(4) { left: 19.69%; }

[dir="rtl"] .contact-card {
  background:
    radial-gradient(ellipse 70% 90% at 85% 0%, rgba(224, 164, 88, 0.1), transparent 70%),
    var(--panel);
}

[dir="rtl"] .contacts address { text-align: right; }
[dir="rtl"] .field input[dir="ltr"] { text-align: right; }

/* Arabic: cursive script, so no letter spacing (it would pull the joined letters apart);
   taller ascenders and descenders need more leading */

html:lang(ar) :is(h1, h2, .topbar, .eyebrow, .btn, .stat-label, .cycle-steps li, .op-sub, .step-t,
  .contacts dt, .field label, .privacy-updated, .footer) {
  letter-spacing: 0;
}
html:lang(ar) h1 { line-height: 1.3; }
html:lang(ar) h2 { line-height: 1.4; }
html:lang(ar) p { line-height: 1.9; }
/* Arabic glyphs look smaller than Latin ones at the same size */
html:lang(ar) :is(.topbar, .eyebrow, .footer, .stat-label, .op-sub, .step-t, .contacts dt,
  .field label, .privacy-updated) { font-size: 14px; }
html:lang(ar) .btn { font-size: 15px; }
html:lang(ar) .cycle-steps li { font-size: clamp(11px, 3.1cqi, 14px); }
html:lang(ar) :is(.lead, .about-body p) { font-size: clamp(17px, 1.8vw, 19px); }
html:lang(ar) .section-lead { font-size: clamp(16px, 1.7vw, 18px); }
html:lang(ar) :is(.card p, .op p, .step p, .principle p, .privacy p:not(.privacy-updated)) { font-size: 16px; }
html:lang(ar) :is(.contact-steps li, .consent, .form-status) { font-size: 15px; }
html:lang(ar) .tags li { font-size: 13px; }

/* Responsive */

@media (max-width: 960px) {
  .nav { display: none; }
  .lang { margin-inline-start: auto; }
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: 0;
    padding-top: 24px;
  }
  .lead { margin: 0 auto; }
  .actions { justify-content: center; }
  .cycle { width: min(400px, 100%); }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .sequence { grid-template-columns: 1fr; gap: 32px; padding-inline-start: 36px; }
  .sequence::before { top: 0; bottom: 0; inset-inline: 7px auto; border-top: 0; border-inline-start: 1px dashed rgba(201, 208, 220, 0.25); }
  .step { padding-top: 0; }
  .step::before { inset-inline-start: -36px; top: 4px; }
  .principles { grid-template-columns: 1fr; gap: 28px; }
  .contact-card { grid-template-columns: 1fr; grid-template-areas: "intro" "map" "contacts" "form"; }
  .contact-map { min-height: 320px; }
}

@media (max-width: 720px) {
  .topbar { font-size: 11px; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-inline-start: 0; border-top: 0; }
  .cards { grid-template-columns: 1fr; }
  .ops { grid-template-columns: 1fr; }
  .op + .op { border-inline-start: 0; border-top: 1px solid var(--hair); }
  .op { padding: 28px 4px 32px; }
  .footer { justify-content: center; text-align: center; font-size: 10px; letter-spacing: 0.14em; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .step-live::before, .cycle-steps li, .cycle-steps li::before, .nf-pulse { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
  .privacy[open], .form-done { animation: none; }
}
