/* Smart Intelix — portfolio
   Dark by default. Light mode is an explicit choice (data-theme="light") and swaps the tokens only. */

:root {
  color-scheme: dark;
  --bg-a: #3d4147;
  --bg-b: #1c1e21;
  --bg-solid: #26292d;
  --outer: #131416;
  --glass: rgba(255, 255, 255, 0.045);
  --edge: rgba(255, 255, 255, 0.14);
  --ink: #e8e6e1;
  --ink-2: rgba(232, 230, 225, 0.62);
  --ink-3: rgba(232, 230, 225, 0.38);
  --line: rgba(232, 230, 225, 0.12);
  --accent: #3fb3aa;
  --glow: #9ff0f5;
  --scene-line: #ffffff;
  --scene-line-alpha: 0.28;
  --scene-dust: #cfd8d6;
  --halo: rgba(63, 179, 170, 0.35);

  --display: "Archivo", "Archivo Expanded", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --frame-inset: clamp(0px, 2.2vw, 28px);
  --radius: 26px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-a: #f4f5f6;
  --bg-b: #cdd1d6;
  --bg-solid: #e6e8eb;
  --outer: #b9bec4;
  --glass: rgba(255, 255, 255, 0.35);
  --edge: rgba(28, 30, 33, 0.16);
  --ink: #1c1e21;
  --ink-2: rgba(28, 30, 33, 0.66);
  --ink-3: rgba(28, 30, 33, 0.42);
  --line: rgba(28, 30, 33, 0.14);
  --accent: #1f8a83;
  --glow: #0f6f6a;
  --scene-line: #1c1e21;
  --scene-line-alpha: 0.22;
  --scene-dust: #3a4044;
  --halo: rgba(31, 138, 131, 0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--outer);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Floor glow beneath the frame, like a screen resting on a desk */
body::after {
  content: "";
  position: fixed;
  left: 20%; right: 20%; bottom: -10vh;
  height: 26vh;
  background: radial-gradient(ellipse at center, var(--halo), transparent 65%);
  filter: blur(28px);
  pointer-events: none;
}

/* ---------- The device frame ---------- */
.frame {
  position: fixed;
  inset: var(--frame-inset);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 40%, var(--bg-a) 0%, var(--bg-b) 100%);
  border: 1px solid var(--edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 40px 80px -30px rgba(0, 0, 0, 0.6);
  isolation: isolate;
}
.frame::before {
  /* glass sheen */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.09), transparent 45%, rgba(0,0,0,0.12));
  pointer-events: none;
  z-index: 0;
}

.rings {
  position: absolute;
  top: 50%; left: 62%;
  width: 0; height: 0;
  z-index: 0;
  pointer-events: none;
}
.rings i {
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid var(--line);
  width: 54vmin; height: 54vmin;
}
.rings i:nth-child(2) { width: 68vmin; height: 68vmin; opacity: .7; }
.rings i:nth-child(3) { width: 84vmin; height: 84vmin; opacity: .4; }

#scene {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
  display: block;
}

/* ---------- Header ---------- */
.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--gutter) 0;
  height: 74px;
}
.top::after {
  content: "";
  position: absolute;
  left: var(--gutter); right: var(--gutter); bottom: 0;
  height: 1px;
  background: var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 30px; height: 30px; }
.brand-word {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand-word b { font-weight: 500; color: var(--accent); }

.nav { position: relative; }
.nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: clamp(18px, 3.4vw, 44px);
}
.nav li.gap { margin-left: clamp(24px, 9vw, 170px); }
.nav a {
  display: block;
  padding: 10px 2px 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  transition: color .3s;
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.nav-glow {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 40px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px 2px var(--accent), 0 0 30px 6px var(--halo);
  transition: left .5s cubic-bezier(.65,0,.2,1), width .5s cubic-bezier(.65,0,.2,1);
}

.counter {
  position: absolute;
  z-index: 5;
  top: 92px;
  left: var(--gutter);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}
.mono { font-family: var(--mono); }

/* ---------- Panels ---------- */
.scroller {
  position: absolute; inset: 0;
  z-index: 3;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.scroller::-webkit-scrollbar { display: none; }

.panel {
  position: relative;
  min-height: 100%;
  scroll-snap-align: start;
  display: grid;
  align-items: center;
  padding: 116px var(--gutter) 84px;
}
.copy {
  max-width: 34rem;
  display: grid;
  gap: 20px;
  align-content: center;
}
.copy.wide { max-width: 48rem; }

.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.08;
  text-wrap: balance;
  text-shadow: 0 2px 30px rgba(0,0,0,0.25);
}
h1 { font-size: clamp(30px, 4.2vw, 56px); }
h2 { font-size: clamp(26px, 3.4vw, 44px); }
.copy.wide h2 { font-size: clamp(24px, 2.7vw, 36px); }
.copy.wide { gap: 16px; }
h3 {
  margin: 0 0 4px;
  font-family: var(--body);
  font-weight: 500;
  font-size: 16px;
}
.lede {
  margin: 0;
  max-width: 30rem;
  color: var(--ink-2);
  font-size: 15px;
}
.cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 18px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color .3s, box-shadow .3s;
}
.cta:hover { border-color: var(--accent); box-shadow: 0 0 24px -6px var(--accent); }
.cta:focus-visible, .copy-btn:focus-visible, .theme:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* Services index */
.index {
  list-style: none;
  margin: 8px 0 0; padding: 0;
  display: grid;
}
.index li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.index li:last-child { border-bottom: 1px solid var(--line); }
.index p { margin: 0; color: var(--ink-2); max-width: 30rem; }
.k { color: var(--accent); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; padding-top: 4px; }

/* Product rows */
.cases {
  list-style: none;
  margin: 8px 0 0; padding: 0;
}
.cases > li { border-top: 1px solid var(--line); }
.cases > li:last-child { border-bottom: 1px solid var(--line); }
.cases summary, .cases .row {
  display: grid;
  grid-template-columns: 96px 1fr auto 16px;
  grid-template-areas: "k h s x" "k p s x";
  column-gap: 16px;
  padding: 15px 0;
  align-items: baseline;
  list-style: none;
  cursor: pointer;
}
.cases .row { cursor: default; grid-template-columns: 96px 1fr auto; grid-template-areas: "k h s" "k p s"; }
.cases summary::-webkit-details-marker { display: none; }
.cases summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.cases summary:hover h3 { color: var(--accent); }
.cases .k { grid-area: k; }
.cases h3 { grid-area: h; transition: color .3s; }
.cases p { grid-area: p; margin: 0; color: var(--ink-2); font-size: 14px; }
.stat {
  grid-area: s;
  align-self: center;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink);
  padding: 6px 10px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--glass);
  white-space: nowrap;
}
.plus {
  grid-area: x;
  align-self: center;
  position: relative;
  width: 12px; height: 12px;
  color: var(--ink-3);
  transition: transform .35s cubic-bezier(.65,0,.2,1), color .3s;
}
.plus::before, .plus::after {
  content: "";
  position: absolute;
  left: 0; top: 5.5px;
  width: 12px; height: 1px;
  background: currentColor;
}
.plus::after { transform: rotate(90deg); }
.cases details[open] .plus { transform: rotate(45deg); color: var(--accent); }
.cases summary:hover .plus { color: var(--accent); }
.caps {
  margin: 0; padding: 2px 0 18px 112px;
  list-style: none;
  counter-reset: cap;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  max-width: 42rem;
}
.caps li {
  counter-increment: cap;
  position: relative;
  padding-left: 26px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
}
.caps li::before {
  content: counter(cap, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* Plans: subscription units */
.units {
  list-style: none;
  margin: 8px 0 0; padding: 0;
}
.units li {
  display: grid;
  grid-template-columns: 130px 1fr;
  grid-template-areas: "k h" "k p";
  column-gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
}
.units li:last-child { border-bottom: 1px solid var(--line); }
.units .k { grid-area: k; color: var(--ink); }
.units h3 { grid-area: h; font-size: 15px; }
.units p { grid-area: p; margin: 0; color: var(--ink-2); font-size: 13px; max-width: 38rem; }

/* Team */
.disciplines {
  list-style: none;
  margin: 8px 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 10px;
}
.disciplines li {
  padding: 8px 14px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Contact */
.mail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.mail-addr {
  font-size: clamp(16px, 2.2vw, 24px);
  color: var(--ink);
  letter-spacing: 0.02em;
  user-select: all;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}
.copy-btn, .theme {
  appearance: none;
  border: 1px solid var(--edge);
  background: var(--glass);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .3s, border-color .3s;
}
.copy-btn:hover, .theme:hover { color: var(--ink); border-color: var(--accent); }
.fine { margin: 0; font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; }


/* ---------- Bottom chrome ---------- */
.hint {
  transition: opacity .4s;
  position: absolute;
  z-index: 5;
  left: 50%; bottom: 22px;
  translate: -50% 0;
  color: var(--ink-3);
}
.hint.is-hidden { opacity: 0; }
.theme {
  position: absolute;
  z-index: 5;
  right: var(--gutter); bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .cases summary { grid-template-columns: 1fr 16px; grid-template-areas: "k x" "h x" "p x" "s x"; row-gap: 4px; }
  .cases .row { grid-template-columns: 1fr; grid-template-areas: "k" "h" "p" "s"; row-gap: 4px; }
  .stat { justify-self: start; margin-top: 6px; }
  .caps { grid-template-columns: 1fr; padding-left: 0; }
  .units li { grid-template-columns: 1fr; grid-template-areas: "k" "h" "p"; row-gap: 2px; }
  .disciplines { grid-template-columns: repeat(2, auto); }
  .nav li.gap { margin-left: 0; }
  .rings { left: 50%; }
}
@media (max-width: 640px) {
  :root { --frame-inset: 0px; --radius: 0px; }
  .frame { border: 0; }
  body::after { display: none; }
  .top { height: 64px; padding-top: 14px; }
  .brand-word { display: none; }
  .nav { max-width: calc(100vw - 80px); overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav ul { gap: 9px; }
  .nav a { font-size: 9px; letter-spacing: 0.06em; padding-bottom: 16px; white-space: nowrap; }
  .counter { top: 78px; }
  .panel { padding: 110px var(--gutter) 80px; }
  .copy { position: relative; }
  /* scrim so the text stays readable over the scene */
  .copy::before {
    content: "";
    position: absolute;
    inset: -20px -14px;
    z-index: -1;
    border-radius: 20px;
    background: color-mix(in srgb, var(--bg-solid) 74%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroller { scroll-behavior: auto; }
  .nav-glow, .cta, .copy-btn, .theme { transition: none; }
  .hint svg animate { display: none; }
}
