/* Decision Systems portfolio — v2 design system
   Dark foundation, pastel accents, glass surfaces, soft motion. */

:root {
  --bg: #09090B;
  --bg-2: #0F172A;
  --text: #F4F4F5;
  --text-2: rgba(244, 244, 245, 0.66);
  --text-3: rgba(244, 244, 245, 0.42);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-2: rgba(255, 255, 255, 0.08);
  --blue: #A7D8F5;
  --mint: #B8F2E6;
  --pink: #F7C6D9;
  --lavender: #D6CCFF;
  --peach: #FFD6BA;
  --yellow: #FFF4B5;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --r-card: 24px;
  --r-pill: 9999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(167, 216, 245, 0.3); }

/* ---- Background layers: gradient blobs + grain ---- */
.bg { position: fixed; inset: -20%; z-index: -2; overflow: hidden; will-change: transform; }
.blob { position: absolute; border-radius: 50%; filter: blur(95px); opacity: 0.45; }
.blob.b1 { width: 46vw; height: 46vw; left: -8%; top: -12%;
  background: radial-gradient(circle, #A7D8F5 0%, transparent 65%); animation: drift1 34s ease-in-out infinite alternate; }
.blob.b2 { width: 40vw; height: 40vw; right: -10%; top: 16%;
  background: radial-gradient(circle, #D6CCFF 0%, transparent 65%); animation: drift2 42s ease-in-out infinite alternate; }
.blob.b3 { width: 36vw; height: 36vw; left: 26%; bottom: -14%;
  background: radial-gradient(circle, #B8F2E6 0%, transparent 65%); animation: drift3 38s ease-in-out infinite alternate; }
.blob.b4 { width: 26vw; height: 26vw; right: 22%; bottom: 8%;
  background: radial-gradient(circle, #FFD6BA 0%, transparent 65%); opacity: 0.18; animation: drift1 46s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(6vw, 5vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-5vw, 7vh) scale(0.92); } }
@keyframes drift3 { to { transform: translate(4vw, -6vh) scale(1.08); } }

body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.05;
  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'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

#glow {
  position: fixed; width: 340px; height: 340px; border-radius: 50%;
  pointer-events: none; z-index: 0; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(167, 216, 245, 0.09) 0%, transparent 62%);
}

/* ---- Layout ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding-left: 28px; padding-right: 28px; position: relative; z-index: 1; }
.narrow { max-width: 760px; }
section { padding: 100px 0; scroll-margin-top: 90px; }
section + section { padding-top: 0; }

/* ---- Nav: floating glass pill ---- */
.nav {
  position: sticky; top: 18px; z-index: 50;
  max-width: 1120px; margin: 18px auto 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 26px; border-radius: var(--r-pill);
}
.nav .brand { font-weight: 600; letter-spacing: -0.02em; color: var(--text); text-decoration: none; font-size: 1.02rem; }
.nav .links { display: flex; align-items: center; gap: 26px; }
.nav .links a { color: var(--text-2); text-decoration: none; font-size: 0.92rem; }
.nav .links a:hover { color: var(--text); }
@media (max-width: 1180px) { .nav { margin: 18px 20px 0; } }

/* ---- Glass surfaces ---- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.lift { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s, box-shadow 0.35s; }
.lift:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--acc, #A7D8F5) 40%, transparent);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45),
              0 0 46px color-mix(in srgb, var(--acc, #A7D8F5) 12%, transparent);
}

/* ---- Typography ---- */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.03em; line-height: 1.08; }
h1 { font-size: clamp(2.6rem, 6.5vw, 4.9rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 18px; }
h3 { font-size: 1.22rem; letter-spacing: -0.015em; }
p { color: var(--text-2); }
strong { color: var(--text); font-weight: 600; }
.eyebrow {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 18px;
}
.u { color: var(--text); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size 0.3s ease; }
.u:hover { background-size: 100% 1px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  border-radius: var(--r-pill); padding: 14px 28px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover { transform: scale(1.045); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue); color: #0B1220; box-shadow: 0 10px 34px rgba(167, 216, 245, 0.22); }
.btn-primary:hover { box-shadow: 0 14px 44px rgba(167, 216, 245, 0.32); }
.btn-ghost { background: var(--glass); border: 1px solid var(--line-2); color: var(--text);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.btn .arr { transition: transform 0.25s ease; }
.btn:hover .arr { transform: translateX(4px); }

/* ---- Chips ---- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 13px; border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--acc, #A7D8F5) 45%, transparent);
  color: var(--acc, #A7D8F5);
}
.chip.dim { border-color: var(--line); color: var(--text-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc, #A7D8F5); }

/* ---- Hero ---- */
.hero { position: relative; padding-top: 110px; padding-bottom: 44px; min-height: 74vh; display: flex; align-items: center; }
.hero-inner { position: relative; z-index: 2; max-width: 780px; }
.hero p.sub { font-size: 1.18rem; max-width: 46ch; margin: 26px 0 38px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
#pixels {
  position: absolute; right: -4%; top: 6%; width: 46%; height: 88%;
  z-index: 1; opacity: 0.8; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 75%);
}

/* ---- Stats band ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.stat { padding: 24px 26px; border-radius: var(--r-card); }
.stat b { display: block; font-family: var(--mono); font-size: 1.7rem; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.stat span { font-size: 0.88rem; color: var(--text-2); }

/* ---- Bento ---- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.tile { padding: 30px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--text); position: relative; overflow: hidden; }
.tile .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tile h3 { font-size: 1.45rem; }
.tile p { font-size: 0.97rem; flex-grow: 1; }
.tile .go { font-family: var(--mono); font-size: 0.75rem; color: var(--acc, #A7D8F5); letter-spacing: 0.08em; }
.tile::before {
  content: ""; position: absolute; right: -70px; top: -70px; width: 190px; height: 190px;
  border-radius: 50%; filter: blur(56px); opacity: 0.14; pointer-events: none;
  background: var(--acc, #A7D8F5); transition: opacity 0.4s ease;
}
.tile:hover::before { opacity: 0.28; }
.t-3 { grid-column: span 3; }
.t-2 { grid-column: span 2; }
.t-6 { grid-column: span 6; }
.t-tall { grid-row: span 2; }
@media (max-width: 900px) { .t-3, .t-2 { grid-column: span 6; } }

/* ---- Timeline ---- */
.timeline { display: flex; gap: 0; overflow-x: auto; padding: 8px 2px 18px; }
.tl-item { min-width: 230px; padding: 0 26px 0 0; position: relative; }
.tl-item .tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--acc, #A7D8F5); margin-bottom: 14px; box-shadow: 0 0 16px color-mix(in srgb, var(--acc, #A7D8F5) 60%, transparent); }
.tl-item::before { content: ""; position: absolute; left: 12px; top: 5px; right: 8px; height: 1px; background: var(--line); }
.tl-item time { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.tl-item p { font-size: 0.9rem; margin-top: 6px; }

/* ---- Case pages ---- */
.case-hero { padding-top: 96px; padding-bottom: 30px; }
.case-hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 24ch; }
.case-hero .sub { font-size: 1.13rem; max-width: 56ch; margin-top: 22px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 44px 0; }
.kpi { padding: 24px 26px; }
.kpi b { display: block; font-family: var(--mono); font-size: 1.5rem; font-weight: 500; color: var(--acc, #A7D8F5); }
.kpi span { font-size: 0.86rem; color: var(--text-2); }
.prose { max-width: 66ch; }
.prose p { margin-bottom: 1.15em; }
.prose h2 { margin-top: 2.2em; }
.prose ul { margin: 0 0 1.2em 1.15em; color: var(--text-2); }
.prose li { margin-bottom: 0.55em; }
.prose li::marker { color: var(--acc, #A7D8F5); }

/* ---- Steps (how it works) ---- */
.steps { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 10px; }
.step { padding: 16px 20px; border-radius: 18px; font-size: 0.9rem; }
.step b { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acc, #A7D8F5); margin-bottom: 4px; font-weight: 500; }
.step.human b { color: var(--pink); }
.step.human { border-color: color-mix(in srgb, var(--pink) 45%, transparent); }
.steps .sarr { align-self: center; color: var(--text-3); font-family: var(--mono); }

/* ---- Details (progressive disclosure) ---- */
details { margin: 22px 0; border-radius: var(--r-card); padding: 20px 26px; }
details summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--text); }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font-family: var(--mono); color: var(--text-3); font-size: 1.15rem; transition: transform 0.3s ease; }
details[open] summary::after { transform: rotate(45deg); }
details .body { margin-top: 16px; color: var(--text-2); font-size: 0.95rem; }
details .body ul { margin: 0 0 0 1.1em; }
details .body li { margin-bottom: 0.5em; }

/* ---- Contact form ---- */
.contact-card { padding: 52px 44px; border-radius: 28px; max-width: 720px; margin: 0 auto; }
.contact-card h2 { margin-bottom: 10px; }
.contact-card > p { max-width: 52ch; margin-bottom: 28px; }
#contact-form { display: flex; flex-direction: column; gap: 14px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.finput {
  width: 100%; background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 18px; color: var(--text);
  font-family: var(--sans); font-size: 0.95rem; line-height: 1.5;
  transition: border-color 0.25s ease, background 0.25s ease;
  resize: vertical;
}
.finput::placeholder { color: var(--text-3); }
.finput:focus { outline: none; border-color: color-mix(in srgb, var(--blue) 55%, transparent); background: rgba(255, 255, 255, 0.07); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.factions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.factions .btn[disabled] { opacity: 0.55; pointer-events: none; }
.form-status { font-size: 0.88rem; color: var(--text-2); margin: 0; min-height: 1.4em; }
.form-status.ok { color: var(--mint); }
.form-status.err { color: var(--pink); }
@media (max-width: 640px) { .frow { grid-template-columns: 1fr; } .contact-card { padding: 38px 24px; } }

/* ---- Footer ---- */
footer { padding: 40px 0 60px; }
footer .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 28px 34px; }
footer p { font-size: 0.88rem; color: var(--text-3); }
footer a { color: var(--text-2); }

/* ---- Pixel-art icons ---- */
.px-icon { width: 88px; color: var(--acc, var(--blue)); margin: 10px 0 4px; }
.px-icon svg { display: block; width: 100%; height: auto; }
.px-icon.px-lg { width: 72px; margin: 0 0 26px; }
@keyframes px-tw { 0%, 100% { opacity: 1; } 50% { opacity: 0.22; } }
.px-icon .tw { animation: px-tw 3s ease-in-out infinite; }
.px-icon.px-scene { width: 100%; margin: 0; }

/* ---- Art gallery ---- */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 32px; }
.art-card { padding: 0; overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.art-card .thumb {
  aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 34px;
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--acc, var(--lavender)) 22%, transparent),
    color-mix(in srgb, var(--acc2, var(--blue)) 16%, transparent));
  border-bottom: 1px solid var(--line);
}
.art-card .thumb .px-scene { width: 46%; color: var(--acc, var(--lavender)); }
.art-card .body { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 10px; }
.art-card h3 { font-size: 1.35rem; }
.art-card p { font-size: 0.95rem; }
.art-card .go { font-family: var(--mono); font-size: 0.75rem; color: var(--acc, var(--lavender)); letter-spacing: 0.08em; }

/* Atlas strip on the detail page */
.atlas { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; margin: 26px 0 8px; }
.atlas .cell {
  aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center; padding: 20px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--cc, var(--mint)) 14%, rgba(255,255,255,0.03));
}
.atlas .cell > span { display: grid; place-items: center; width: 100%; font-size: 0; line-height: 0; }
.atlas .cell .px-scene { width: 62%; color: var(--cc, var(--mint)); }

/* Countries Atlas — faithful game scenes */
.atlas-svg { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.atlas-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 26px 0 8px; }
.atlas-card { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: rgba(255,255,255,0.03); }
.atlas-card [data-atlas] { line-height: 0; border-bottom: 1px solid var(--line); }
.atlas-card figcaption { padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.atlas-card figcaption b { font-size: 0.98rem; font-weight: 600; }
.atlas-card figcaption span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }

/* Small scene strip (e.g. the art gallery card thumbnail) */
.scene-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.scene-strip [data-atlas] { line-height: 0; border-radius: 8px; overflow: hidden; }

/* ---- Personal logo: pixel robot ---- */
.nav .brand.has-mark { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { display: inline-flex; height: 22px; transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.logo-mark { height: 100%; width: auto; image-rendering: pixelated; }
.nav .brand:hover .brand-mark { transform: translateY(-1px) rotate(-4deg); }

.signature { margin: 40px 0 0; max-width: 360px; }
.signature .frame { line-height: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4); }
.logo-scene { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.signature figcaption { margin-top: 14px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.02em; color: var(--text-3); line-height: 1.5; }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Tilt ---- */
.tilt { transform-style: preserve-3d; will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 700px) {
  section { padding: 64px 0; scroll-margin-top: 80px; }
  .hero { padding-top: 70px; padding-bottom: 32px; min-height: 0; }
  #pixels { display: none; }
  .nav .links { gap: 15px; }
  .nav .links a.hide-m { display: none; }
}
