/* ===========================================================
   ArveNova AI — "engineering instrument" theme
   Full scrolling page: top nav + hero + content sections.
   =========================================================== */

/* --- Design tokens --- */
:root {
  --bg: #080a0f;
  --panel-bg: #0b0e15;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #eef1f6;
  --muted: #888fa1;
  --faint: #565d70;
  --accent: #2ee6c6;   /* teal-cyan */
  --accent-2: #ffb454; /* amber */

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --topbar-h: 66px;
  --footer-h: 40px;
  --container: 1180px;
}

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

button {
  font-family: inherit;
  font-size: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--footer-h);

  /* Keep untranslated text hidden until i18n has loaded */
  opacity: 0;
  transition: opacity 0.35s ease;
}

body.loaded {
  opacity: 1;
}

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

/* =====================================================================
   ATMOSPHERE (fixed backdrop layers)
   ===================================================================== */
.bg-grid,
.bg-glow,
.bg-grain,
#network {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.bg-grid {
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 75% at 50% 32%, #000 26%, transparent 78%);
          mask-image: radial-gradient(ellipse 80% 75% at 50% 32%, #000 26%, transparent 78%);
  opacity: 0.5;
}

.bg-glow {
  z-index: 0;
  background:
    radial-gradient(56% 46% at 50% 20%, rgba(46, 230, 198, 0.12), transparent 70%),
    radial-gradient(40% 38% at 80% 75%, rgba(255, 180, 84, 0.06), transparent 72%);
}

#network {
  z-index: 0;
}

.bg-grain {
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =====================================================================
   TOP NAV BAR
   ===================================================================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(8, 10, 15, 0.88), rgba(8, 10, 15, 0.6));
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
}

.brand-mark {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 12px rgba(46, 230, 198, 0.5);
  animation: spin-diamond 9s linear infinite;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.2px;
}

.brand-ai {
  color: var(--accent);
  margin-left: 3px;
}

.mainnav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navlink {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 13px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.navlink:hover {
  color: var(--text);
  background: var(--surface);
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  border-radius: 11px;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #05201b;
  box-shadow: 0 0 0 1px rgba(46, 230, 198, 0.4), 0 10px 34px rgba(46, 230, 198, 0.18);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(46, 230, 198, 0.6), 0 14px 40px rgba(46, 230, 198, 0.3);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-2);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: var(--accent);
}

.btn-contact {
  font-size: 14px;
  padding: 10px 18px;
  margin-left: 6px;
  background: var(--accent);
  color: #05201b;
  border-radius: 9px;
}

.btn-contact:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(46, 230, 198, 0.25);
}

/* =====================================================================
   LANGUAGE DROPDOWN
   ===================================================================== */
.lang {
  position: relative;
  margin: 0 2px 0 6px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}

.lang-toggle:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.lang-globe {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
}

.lang-caret {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  transition: transform 0.2s;
}

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

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 178px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel-bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 40;
}

html[dir="rtl"] .lang-menu {
  right: auto;
  left: 0;
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.lang-option:hover {
  background: var(--surface);
  color: var(--text);
}

.lang-option[aria-selected="true"] {
  color: var(--text);
  background: var(--surface-2);
}

.lang-opt-code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}

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

/* =====================================================================
   LAYOUT PRIMITIVES
   ===================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  position: relative;
  z-index: 10;
  padding: clamp(72px, 11vh, 128px) 0;
  scroll-margin-top: calc(var(--topbar-h) + 18px);
  border-top: 1px solid var(--line);
}

.section-index {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.section-index::before {
  content: "// ";
  color: var(--faint);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-intro {
  margin: 24px 0 0;
  max-width: 64ch;
  font-size: clamp(1.2rem, 1.6vw, 1.45rem);
  line-height: 1.65;
  color: var(--muted);
}

/* =====================================================================
   ACCORDION (collapsible main sections)
   ===================================================================== */
.section.accordion {
  padding: 4px 0;
}

.acc-h {
  margin: 0;
}

.acc-toggle {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 22px;
  padding: clamp(22px, 3vh, 34px) 0;
  text-align: left;
  cursor: pointer;
}

html[dir="rtl"] .acc-toggle {
  text-align: right;
}

.acc-toggle .section-index {
  margin: 0;
  flex: none;
  align-self: center;
}

.acc-toggle .section-title {
  flex: 1 1 auto;
  transition: color 0.2s;
}

.acc-toggle:hover .section-title {
  color: var(--accent);
}

.acc-chevron {
  flex: none;
  align-self: center;
  width: 30px;
  height: 30px;
  display: inline-flex;
  color: var(--muted);
  transition: transform 0.3s ease, color 0.2s;
}

.acc-chevron svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.acc-toggle[aria-expanded="true"] .acc-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

/* Smoothly collapsing region (animated via grid-template-rows). */
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}

.acc-body.open {
  grid-template-rows: 1fr;
}

.acc-inner {
  overflow: hidden;
  min-height: 0;
}

/* Bottom breathing room only when expanded — otherwise the item's own
   padding would keep the collapsed (0fr) row from reaching zero height. */
.acc-body.open .acc-inner {
  padding-bottom: clamp(40px, 6vh, 72px);
}

.acc-inner > .section-intro {
  margin-top: 0;
}

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--topbar-h) + 40px) 20px 80px;
}

.orbit {
  width: 84px;
  height: 84px;
  margin-bottom: 26px;
}

.orbit-ring {
  fill: none;
  stroke: var(--line-2);
  stroke-width: 1;
}

.orbit-ring--inner {
  stroke-dasharray: 3 5;
  opacity: 0.7;
}

.orbit-core {
  fill: var(--accent);
}

.orbit-spin {
  transform-origin: 50px 50px;
  animation: spin 6s linear infinite;
}

.orbit-spin--slow {
  animation-duration: 14s;
}

.orbit-spin--rev {
  animation-duration: 10s;
  animation-direction: reverse;
}

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

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

.kicker {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker::before {
  content: "// ";
  color: var(--faint);
}

.display {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 8vw, 5.5rem); /* up to ~88px */
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--text);
}

.lede {
  margin: 26px auto 0;
  max-width: 52ch;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--muted);
}

.cta-row {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/* =====================================================================
   WHAT WE DO — capability cards
   ===================================================================== */
.cap-grid {
  margin-top: 52px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  scroll-margin-top: calc(var(--topbar-h) + 18px);
}

.cap-card {
  padding: 30px 30px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.cap-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(46, 230, 198, 0.25);
}

.cap-index {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.cap-title {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.2;
  color: var(--text);
}

.cap-desc {
  margin: 14px 0 0;
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--muted);
}

/* =====================================================================
   PRODUCT — MeetArven
   ===================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.product-copy .section-title {
  margin-top: 18px;
}

.product-copy .btn {
  margin-top: 30px;
}

.product-visual {
  display: flex;
  justify-content: center;
}

.product-orbit {
  width: min(360px, 100%);
  height: auto;
}

/* --- Projects: two project cards (Meet Arven + Uksay) --- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}
@media (max-width: 768px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
  display: flex;
  flex-direction: column;
  padding: 30px 30px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(46, 230, 198, 0.25);
}
.project-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--text);
}
.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.project-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.project-badge--live { color: var(--accent); border: 1px solid var(--accent); }
.project-badge--live::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.project-badge--soon { color: var(--accent-2); border: 1px solid var(--accent-2); }
.project-badge--soon::before { background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); }

.project-desc {
  margin: 16px 0 0;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--muted);
  flex: 1;
}
.project-btn { margin-top: 26px; align-self: flex-start; }
.project-btn--disabled {
  background: var(--surface-2);
  color: var(--faint);
  border: 1px solid var(--line);
  cursor: not-allowed;
  opacity: 0.75;
}
.project-btn--disabled:hover { transform: none; box-shadow: none; }

/* =====================================================================
   FOUNDATIONS
   ===================================================================== */
.found-line {
  margin: 18px 0 0;
  max-width: 60ch;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--faint);
}

.stat-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
  color: var(--accent);
}

.stat-label {
  margin-top: 12px;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--muted);
}

/* =====================================================================
   CONTACT
   ===================================================================== */
.contact-block {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 640px;
}

.contact-legal {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--text);
}

.contact-row {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.contact-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.contact-value {
  font-size: 1.25rem;
  color: var(--text);
}

.panel-link {
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.panel-link:hover {
  border-bottom-color: var(--accent);
}

/* =====================================================================
   FOOTER (persistent thin bar)
   ===================================================================== */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footer-h);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, rgba(8, 10, 15, 0.92), rgba(8, 10, 15, 0.7));
  backdrop-filter: blur(8px);
}

.site-footer__line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.site-footer__sep {
  margin: 0 8px;
  opacity: 0.7;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}

.footer-link:hover {
  text-decoration: underline;
}

/* =====================================================================
   404
   ===================================================================== */
.notfound {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  padding: 24px;
}

.notfound-code {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.5rem, 14vw, 8rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.notfound-code .accent {
  color: var(--accent);
}

.notfound-msg {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: 1.05rem;
}

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

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-h: 58px;
  }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
    row-gap: 8px;
  }

  .mainnav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 4px;
  }

  .navlink {
    padding: 7px 10px;
    font-size: 14px;
  }

  .btn-contact {
    margin-left: auto;
  }

  .cap-grid {
    grid-template-columns: 1fr;
  }

  .site-footer__addr {
    display: none;
  }
}

/* =====================================================================
   REDUCED MOTION
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .brand-mark,
  .orbit-spin {
    animation: none;
  }

  .btn,
  .navlink,
  .cap-card,
  .acc-body,
  .acc-chevron {
    transition: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* The diamond mark is pre-rotated 45° — keep that offset while spinning. */
@keyframes spin-diamond {
  from {
    transform: rotate(45deg);
  }
  to {
    transform: rotate(405deg);
  }
}
