/* CODENTICO site */
@font-face {
  font-family: "Rubik";
  src: url("fonts/Rubik.woff2") format("woff2"), url("fonts/Rubik.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #0b0c0e;
  --bg-alt: #0f1113;
  --surface: #14171a;
  --surface-2: #1a1e22;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #eceae4;
  --muted: #a1a3a8;
  --dim: #6f7278;
  --accent: #ffb84d;
  --accent-hi: #ffc976;
  --accent-ink: #1c1306;
  --red: #d7262f;
  --green: #8fd6a4;
  --blue: #7fb6ff;
  --radius: 22px;
  --wrap: 1180px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

.eyebrow {
  font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 12, 14, 0.72);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.top.is-scrolled { border-bottom-color: var(--line); }
.top__row { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--accent); }
.brand__mark { width: 28px; height: 28px; }
.brand__name { color: var(--text); font-weight: 600; letter-spacing: 0.16em; font-size: 15px; }
.brand__name sup { font-size: 9px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 1px; vertical-align: 7px; line-height: 0; }
.nav { display: none; gap: 28px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; transition: color .2s; }
.nav a:hover { color: var(--text); }
.lang { display: flex; margin-left: auto; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; }
.lang a {
  font-size: 12px; font-weight: 600; letter-spacing: .06em; line-height: 1.6; text-decoration: none;
  color: var(--dim); padding: 4px 10px; border-radius: 999px; transition: color .2s;
}
.lang a:hover { color: var(--text); }
.lang a[aria-current="page"] { background: var(--text); color: var(--bg); }
@media (min-width: 760px) {
  .nav { display: flex; }
  .lang { margin-left: 8px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 500; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hi); }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: rgba(255,255,255,.32); }

/* Hero */
.hero { position: relative; padding: 56px 0 72px; overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% -10% auto; height: 760px; pointer-events: none;
  background:
    radial-gradient(55% 75% at 76% 32%, rgba(255, 184, 77, .17), transparent 72%),
    radial-gradient(35% 45% at 15% 10%, rgba(127, 182, 255, .08), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 20%, transparent 80%);
          mask-image: radial-gradient(80% 70% at 50% 30%, #000 20%, transparent 80%);
  opacity: .95;
}
.hero__grid { position: relative; z-index: 1; display: grid; gap: 56px; align-items: center; }
.hero__title {
  margin-top: 18px;
  font-size: clamp(38px, 9vw, 74px); line-height: 1.04; font-weight: 600; letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero__lead { margin-top: 22px; max-width: 34em; color: var(--muted); font-size: clamp(17px, 2.2vw, 19px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.stack { position: relative; height: 340px; max-width: 520px; width: 100%; margin: 0 auto; }
.stack__card {
  position: absolute; overflow: hidden; border-radius: 18px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.7);
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.stack__card img { width: 100%; height: 100%; object-fit: cover; }
.stack__card--drive { width: 68%; aspect-ratio: 16 / 10; left: 0; top: 2%; transform: rotate(-5deg); }
.stack__card--phone {
  z-index: 2;
  width: 30%; aspect-ratio: 9 / 16; left: 24%; top: 18%;
  border: 5px solid #050506; border-radius: 26px; transform: rotate(-3deg);
  box-shadow: 0 0 0 1px var(--line-strong), 0 40px 70px -20px rgba(0,0,0,.85);
}
.stack__card--daodu {
  z-index: 3;
  width: 54%; aspect-ratio: 5 / 4; right: 0; top: 32%; transform: rotate(4deg);
  display: grid; place-items: center;
  background:
    radial-gradient(60% 80% at 80% 10%, rgba(255,255,255,.16), transparent 60%),
    linear-gradient(135deg, #e3343c, var(--red) 50%, #8e1118);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 40px 80px -20px rgba(0,0,0,.9);
}
.stack__card--daodu .daodu { font-size: clamp(30px, 8vw, 46px); }
.stack__card--daodu .daodu small { font-size: clamp(10px, 2.4vw, 13px); }
.stack:hover .stack__card--drive { transform: rotate(-7deg) translate(-6px, -4px); }
.stack:hover .stack__card--phone { transform: rotate(-5deg) translate(-6px, -6px); }
.stack:hover .stack__card--daodu { transform: rotate(2deg) translateY(-8px); }

/* Phones and tablets: text only, the collage is for wide screens */
@media (max-width: 959px) {
  .stack { display: none; }
  .hero { padding: 48px 0 56px; }
  .hero__glow {
    height: 520px;
    background:
      radial-gradient(80% 70% at 66% 38%, rgba(255, 184, 77, .17), transparent 72%),
      radial-gradient(35% 45% at 15% 10%, rgba(127, 182, 255, .08), transparent 70%);
  }
}
/* Phones: the first screen fills the viewport — label at the top, text in the middle, project list at the bottom */
@media (max-width: 559px) {
  .hero { padding: 16px 0 20px; }
  .hero__text {
    display: flex; flex-direction: column;
    min-height: calc(100vh - 64px - 36px);
    min-height: calc(100svh - 64px - 36px);
  }
  .hero .eyebrow {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px 7px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
    background: rgba(255, 255, 255, .03);
    font-size: 11px; letter-spacing: .1em;
  }
  .hero .eyebrow::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 3px rgba(255, 184, 77, .18);
  }
  .hero__title { margin-top: 40px; font-size: clamp(36px, 10.4vw, 48px); line-height: 1.06; }
  .hero__lead { margin-top: 16px; font-size: 16.5px; line-height: 1.6; }
  .hero__actions { flex-wrap: nowrap; gap: 10px; margin-top: 24px; }
  .hero__actions .btn { height: 44px; padding: 0 20px; font-size: 15px; }
  .hero__index { margin-top: auto; padding-top: 32px; }
}

/* Project index: replaces the collage on narrow screens */
.hero__index { margin-top: 56px; }
.hero__index-label {
  margin-bottom: 10px;
  font-size: 12px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--dim);
}
.hero__index ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.hero__index a {
  display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: background-color .2s;
}
.hero__index a:active { background: rgba(255,255,255,.03); }
.hero__n { font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--dim); }
.hero__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero__name { font-size: 16px; font-weight: 500; }
.hero__index .status { gap: 7px; font-size: 12.5px; font-weight: 400; color: var(--dim); }
.hero__index .status i { width: 6px; height: 6px; }
.hero__index .status i::after { display: none; }
.hero__index .status--soon i { background: var(--accent); }
.hero__index .status--dev i { background: var(--blue); }
.hero__index .status--proto i { background: var(--green); }
.hero__arrow { font-size: 15px; color: var(--dim); }
@media (min-width: 960px) { .hero__index { display: none; } }

@media (min-width: 960px) {
  .hero { padding: 96px 0 120px; }
  .hero__grid { grid-template-columns: 1.15fr 1fr; }
  .stack { height: 440px; }
}

/* Sections */
.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 40px; }
.section__title {
  margin-top: 12px;
  font-size: clamp(30px, 5vw, 48px); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em;
}
@media (min-width: 960px) { .section { padding: 120px 0; } .section__head { margin-bottom: 56px; } }

/* Status pill */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; position: relative; }
.status--soon { color: var(--accent); }
.status--soon i::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor;
  animation: ping 2s ease-out infinite;
}
.status--dev { color: var(--blue); }
.status--proto { color: var(--green); }
@keyframes ping { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }

/* Featured project */
.feature {
  display: grid; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.feature__body { padding: 28px 22px 32px; display: flex; flex-direction: column; gap: 22px; }
.feature__id { display: flex; align-items: center; gap: 16px; }
.feature__icon { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line-strong); }
.feature__title { margin-top: 4px; font-size: clamp(26px, 4vw, 34px); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
.feature__text { color: var(--muted); }
.facts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.facts li { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; }
.facts li span:first-child { font-weight: 500; }
.facts li span:last-child { color: var(--dim); font-size: 14px; }
.feature__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.feature__media { position: relative; min-height: 380px; overflow: hidden; background: #1b2a20; }
.feature__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; filter: saturate(.9); }
.feature__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,23,26,.1) 40%, rgba(20,23,26,.85));
}
.phones { position: absolute; inset: 0; z-index: 1; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 0; }
.phone {
  margin: 0; width: 34%; max-width: 190px; aspect-ratio: 9 / 16; overflow: hidden;
  border: 5px solid #050506; border-radius: 26px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 30px 60px -10px rgba(0,0,0,.8);
  transform: translateY(18%);
}
.phone img { width: 100%; height: 100%; object-fit: cover; }
.phone--l { transform: translate(14%, 30%) rotate(-7deg); }
.phone--c { position: relative; z-index: 2; width: 38%; max-width: 214px; transform: translateY(12%); }
.phone--r { transform: translate(-14%, 30%) rotate(7deg); }

@media (min-width: 960px) {
  .feature { grid-template-columns: 1fr 1fr; }
  .feature__body { padding: 40px 44px; justify-content: center; }
  .feature__media { min-height: 460px; }
  .phone { max-width: 168px; }
  .phone--c { max-width: 190px; }
  .feature__media::after { background: linear-gradient(90deg, rgba(20,23,26,.6), rgba(20,23,26,0) 35%), linear-gradient(180deg, transparent 55%, rgba(20,23,26,.7)); }
  .phones { align-items: center; }
  .phone { transform: none; }
  .phone--l { transform: translate(16%, 6%) rotate(-7deg); }
  .phone--c { transform: translateY(-2%); }
  .phone--r { transform: translate(-16%, 6%) rotate(7deg); }
}

/* Cards */
.cards { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .3s, transform .3s;
}
.card:hover { border-color: var(--line-strong); }
.card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .card__media img { transform: scale(1.04); }
.card__media--daodu {
  display: grid; place-items: center;
  background:
    radial-gradient(60% 80% at 80% 10%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(135deg, #e3343c, var(--red) 50%, #8e1118);
}
.daodu { color: #fff; font-weight: 700; font-size: clamp(40px, 8vw, 64px); letter-spacing: .06em; line-height: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.daodu small { font-size: 13px; font-weight: 500; letter-spacing: .5em; margin-right: -.5em; opacity: .8; }
.card__body { padding: 24px 22px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__title { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.card__body p { color: var(--muted); }
.card__body .tags { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 13px; color: var(--muted); padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; }

/* Principles */
.principles { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.principles li { background: var(--bg-alt); padding: 28px 22px 32px; }
.principles__n { font-size: 13px; font-weight: 500; color: var(--accent); letter-spacing: .1em; }
.principles h3 { margin-top: 18px; font-size: 20px; font-weight: 600; }
.principles p { margin-top: 8px; color: var(--muted); font-size: 16px; }
@media (min-width: 640px) { .principles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .principles { grid-template-columns: repeat(4, 1fr); } .principles li { padding: 32px 28px 40px; } }

/* Contact */
.contact__box {
  position: relative; overflow: hidden; text-align: center;
  padding: 56px 20px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 90% at 50% 0%, rgba(255,184,77,.12), transparent 70%),
    var(--surface);
}
.contact__box .section__title { margin-inline: auto; }
.contact__text { margin: 16px auto 0; max-width: 30em; color: var(--muted); }
.contact__mail { margin-top: 32px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 16px; }
.mail {
  font-size: clamp(22px, 6vw, 44px); font-weight: 600; letter-spacing: -0.02em; text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
  transition: background-size .35s, color .2s;
}
.mail:hover { color: var(--accent-hi); background-size: 100% 2px; }
.copy {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  height: 40px; padding: 0 16px; border-radius: 999px;
  background: transparent; color: var(--text); border: 1px solid var(--line-strong);
  transition: border-color .2s, color .2s;
}
.copy:hover { border-color: rgba(255,255,255,.32); }
.copy.is-done { color: var(--green); border-color: rgba(143,214,164,.5); }
.contact__note { margin-top: 24px; font-size: 14px; color: var(--dim); }
@media (min-width: 960px) { .contact__box { padding: 88px 40px; } }

/* Footer */
.foot { padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--dim); font-size: 14px; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; }.foot a { color: var(--dim); text-underline-offset: 3px; }
.foot a:hover { color: var(--text); }

/* Reveal on scroll (only with JS) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }

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

/* Phones: tighter vertical rhythm, everything left-aligned */
@media (max-width: 559px) {
  .section { padding: 64px 0; }
  .section__head { margin-bottom: 28px; }
  .contact__box { text-align: left; padding: 36px 22px 32px; }
  .contact__box .section__title { margin-inline: 0; }
  .contact__text { margin-left: 0; }
  .contact__mail { flex-direction: column; align-items: flex-start; gap: 14px; margin-top: 28px; }
  .contact__note { margin-top: 20px; }
}

/* Phones and tablets: game card built like the other cards — art on top, text below */
@media (max-width: 959px) {
  .feature__media { order: -1; min-height: 0; aspect-ratio: 16 / 9; }
  .feature__bg { opacity: 1; filter: none; }
  .feature__media::after { display: none; }
  .phones { display: none; }
  .feature__body { padding: 24px 22px 26px; gap: 18px; }
  .feature__id { gap: 14px; }
  .feature__icon { width: 48px; height: 48px; border-radius: 12px; }
  .feature__title { font-size: 24px; letter-spacing: -0.01em; }
}

/* Phones and tablets: DAODU AUTO first, then the game, then the simulator */
@media (max-width: 959px) {
  #projects > .wrap { display: flex; flex-direction: column; gap: 16px; }
  #projects .cards { display: contents; }
  #projects .section__head { margin-bottom: 12px; }
  #daodu-auto { order: 1; }
  #last-stand { order: 2; }
  #driving-sim { order: 3; }
}

/* === sphere (experiment): animated logo above the headline on phones and tablets. Remove this block to undo. === */
.hero__sphere { display: none; position: relative; }
.hero__sphere svg { position: relative; display: block; width: 100%; height: auto; overflow: visible; }
.hero__sphere::before {
  content: ""; position: absolute; inset: -55%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 184, 77, .2), transparent);
}
@media (max-width: 959px) {
  .hero__sphere { display: block; width: 98px; margin: 32px auto 0; }
  .hero__sphere + .hero__title { margin-top: 32px; }
}

/* === footer brand (experiment): logo, sections and contact above the footer line. Remove this block to undo. === */
.foot { padding-top: 0; }
.foot__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px 24px;
  padding-top: 48px; padding-bottom: 40px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.foot__brand { position: relative; grid-column: 1 / -1; }
.foot__brand::before {               /* soft glow behind the sphere */
  content: ""; position: absolute; left: -50px; top: -50px; width: 150px; height: 150px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 184, 77, .16), transparent);
}
.foot .foot__logo { position: relative; display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.foot__logo svg { width: 46px; height: 46px; overflow: visible; }
.foot__logo span { font-size: 17px; font-weight: 600; letter-spacing: .22em; }
.foot__tag { position: relative; margin-top: 16px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.foot__col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 15px; min-width: 0; }
.foot .foot__col a { color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.foot .foot__col a:hover { color: var(--text); }
.foot__col span { color: var(--dim); font-size: 14px; }
.foot__title { margin-bottom: 6px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.foot__row > a { display: none; }      /* the email is already in the contact column */
@media (min-width: 960px) {
  .foot__grid { grid-template-columns: 2fr 1fr 1fr; gap: 48px; padding-top: 64px; padding-bottom: 56px; margin-bottom: 28px; }
  .foot__brand { grid-column: auto; }
  .foot__brand::before { left: -60px; top: -60px; width: 180px; height: 180px; }
  .foot__logo svg { width: 56px; height: 56px; }
  .foot__logo span { font-size: 20px; }
  .foot__tag { margin-top: 18px; max-width: 26em; }
}

