/* ============================================================
   GABRIELTHECODE.COM · "RECOMPOSITION"
   Design system: dark-first, Kotlin violet, JetBrains Mono labels
   ============================================================ */

:root {
  /* Palette */
  --bg:        #0B0910;
  --bg-elev:   #14111C;
  --bg-code:   #0F0C16;
  --ink:       #EDEBF2;
  --muted:     #9A93AC;
  --line:      rgba(237, 235, 242, 0.09);
  --accent:    #8B5FFF;   /* Kotlin violet, brightened for contrast */
  --accent-soft: rgba(139, 95, 255, 0.14);
  --amber:     #FFB27A;   /* metrics & highlights */
  --green:     #3DDC84;   /* Android green: availability dot only */

  /* Type */
  --font-display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --font-body:    "Satoshi", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Scale */
  --text-xs:  0.75rem;
  --text-sm:  0.875rem;
  --text-md:  1.0625rem;
  --text-lg:  clamp(1.25rem, 1rem + 1vw, 1.625rem);
  --text-xl:  clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
  --text-hero: clamp(2.6rem, 1.4rem + 5.6vw, 6.2rem);

  /* Rhythm */
  --space-section: clamp(6rem, 12vw, 11rem);
  --gutter: clamp(1.25rem, 5vw, 6rem);
  --radius: 18px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.8s;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient grain + violet aura, cheap on GPU */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 80% -10%, rgba(139, 95, 255, 0.10), transparent 60%),
    radial-gradient(50vw 50vw at -10% 40%, rgba(255, 178, 122, 0.05), transparent 60%);
  z-index: 0;
}

main { position: relative; z-index: 1; }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-weight: 400; }
.accent { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Reveal engine ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(rgba(11, 9, 16, 0.75), rgba(11, 9, 16, 0.4));
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav__brand { display: inline-flex; align-items: center; gap: 0.6rem; font-size: var(--text-sm); letter-spacing: 0; }
.nav__mark { display: block; border-radius: 7px; }
.nav__brand-punct { color: var(--accent); }

.nav__links { display: flex; gap: 2rem; font-size: var(--text-sm); font-weight: 500; }
.nav__links a { color: var(--muted); transition: color 0.25s; }
.nav__links a:hover { color: var(--ink); }

.nav__status {
  font-size: var(--text-xs);
  color: var(--amber);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.nav__status span { display: inline-block; transition: transform 0.3s var(--ease-out); }
.nav__status:hover { border-bottom-color: var(--amber); }
.nav__status:hover span { transform: translate(2px, -2px); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem var(--gutter) 4rem;
  position: relative;
}

.hero__eyebrow {
  color: var(--accent);
  font-size: var(--text-sm);
  margin-bottom: 1.6rem;
}

.hero__title {
  font-size: var(--text-hero);
  max-width: 13ch;
}
.hero__title .line { display: block; overflow: hidden; }
.hero__title .word {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 0.9s var(--ease-out) forwards;
}
/* staggered per line */
.hero__title .line:nth-child(1) .word { animation-delay: 0.10s; }
.hero__title .line:nth-child(2) .word { animation-delay: 0.22s; }
.hero__title .line:nth-child(3) .word { animation-delay: 0.34s; }
.hero__title .line:nth-child(4) .word { animation-delay: 0.46s; }

@keyframes rise { to { transform: translateY(0); } }

/* Code window */
.hero__code {
  margin-top: 2.8rem;
  max-width: 560px;
  background: var(--bg-code);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(139, 95, 255, 0.25);
}
.hero__code-bar {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
}
.hero__code-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.hero__code-file { margin-left: auto; font-size: var(--text-xs); color: var(--muted); }
.hero__code pre {
  padding: 1.1rem 1.25rem 1.3rem;
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--muted);
  min-height: 7.2em;
}
.hero__code .caret {
  display: inline-block;
  width: 8px; height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* syntax colors used by typed output */
.tk-k { color: var(--accent); }        /* keyword */
.tk-f { color: #6EC7FF; }              /* function */
.tk-s { color: var(--amber); }         /* string   */
.tk-c { color: #5E5670; }              /* comment  */

.hero__meta {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.5rem, 4vw, 4rem);
}
.stat { display: flex; flex-direction: column; gap: 0.15rem; }
.stat .num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--amber);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat span { color: var(--muted); font-size: var(--text-sm); max-width: 15ch; }

.hero__scroll {
  position: absolute;
  bottom: 2rem; left: var(--gutter);
  font-size: var(--text-xs);
  color: var(--muted);
  transition: color 0.25s;
}
.hero__scroll:hover { color: var(--accent); }

/* ---------- Trust marquee ---------- */
.trust { padding: 3rem 0 1rem; border-top: 1px solid var(--line); }
.trust__label {
  padding: 0 var(--gutter);
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 1.4rem;
}
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track {
  display: flex; align-items: center; gap: 3rem;
  width: max-content;
  animation: scroll 34s linear infinite;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 1.5rem;
}
.marquee__track i { color: var(--accent); font-style: normal; font-size: 0.6em; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: var(--space-section) var(--gutter) 0; max-width: 1280px; margin: 0 auto; }

.section__head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section__tag {
  display: inline-block;
  font-size: var(--text-xs);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  padding: 0.35rem 0.8rem;
  border-radius: 99px;
  margin-bottom: 1.4rem;
}
.section__head h2 { font-size: var(--text-xl); max-width: 16ch; }

/* ---------- About ---------- */
.about__intro {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.about__lede {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.45;
  max-width: 52ch;
  letter-spacing: -0.01em;
}
.about__lede em { font-style: normal; color: var(--accent); }

.about__photo {
  display: flex;
  justify-content: center;
  animation: floaty 7s ease-in-out infinite;
  will-change: transform;
}
.about__photo img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 20px 50px rgba(139, 95, 255, 0.28));
  transition: transform 0.6s var(--ease-out), filter 0.6s var(--ease-out);
}
.about__photo:hover img {
  transform: scale(1.05) rotate(-2deg);
  filter: drop-shadow(0 28px 70px rgba(139, 95, 255, 0.5));
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%      { transform: translateY(-12px) rotate(0.8deg); }
  66%      { transform: translateY(-4px) rotate(-0.8deg); }
}

.about__cols {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
}
.about__cols h3 {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 0.8rem;
}
.about__cols p { color: var(--muted); font-size: var(--text-sm); line-height: 1.7; }

/* ---------- Logcat experience ---------- */
.logcat {
  background: var(--bg-code);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.logcat__bar {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-xs);
  color: var(--muted);
}
.logcat__filter b { color: var(--accent); font-weight: 500; }

.logcat__list { list-style: none; }
.log {
  display: grid;
  grid-template-columns: 150px 130px 1fr;
  gap: 1.4rem;
  padding: 1.6rem 1.4rem;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.3s;
}
.log:last-child { border-bottom: none; }
.log:hover { background: rgba(139, 95, 255, 0.05); }
.log::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s var(--ease-out);
}
.log:hover::before { transform: scaleY(1); }

.log__time { font-size: var(--text-xs); color: var(--muted); padding-top: 0.3rem; display: flex; flex-direction: column; gap: 0.25rem; }
.log__loc { font-style: normal; color: #6B6480; font-size: 0.7rem; }
.log__tag {
  font-size: var(--text-xs);
  color: var(--accent);
  align-self: start;
  padding-top: 0.3rem;
}
.tag--live { color: var(--green); }
.tag--founder { color: var(--amber); }
.log__body h3 { font-size: 1.15rem; font-weight: 500; margin-bottom: 0.4rem; }
.log__body p { color: var(--muted); font-size: var(--text-sm); line-height: 1.7; max-width: 62ch; }

/* ---------- Case studies ---------- */
.case {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-bottom: 1px solid var(--line);
}
.case--flip { grid-template-columns: 1fr minmax(280px, 460px); }
.case--flip .case__media { order: 2; }

.case__media {
  position: relative;
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 4vw, 3rem);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  transition: transform 0.5s var(--ease-out);
  will-change: transform;
}
.case__badge {
  position: absolute;
  top: 1rem; left: 1rem;
  font-size: var(--text-xs);
  color: var(--amber);
  background: rgba(255, 178, 122, 0.1);
  border: 1px solid rgba(255, 178, 122, 0.25);
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
}

/* CSS phone frame */
.phone {
  width: min(230px, 58vw);
  aspect-ratio: 9 / 19;
  background: #060409;
  border: 2px solid rgba(237, 235, 242, 0.18);
  border-radius: 30px;
  padding: 8px;
  position: relative;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
}
.phone__notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 62px; height: 7px;
  border-radius: 99px;
  background: rgba(237, 235, 242, 0.14);
  z-index: 2;
}
.phone__screen {
  width: 100%; height: 100%;
  border-radius: 22px;
  overflow: hidden;
  padding: 2rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.phone__screen.has-img { padding: 0; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 22px; }

/* skeleton UI primitives (kept for future mockups) */
.ui-hero { height: 26%; border-radius: 12px; background: linear-gradient(120deg, rgba(139,95,255,0.35), rgba(255,178,122,0.2)); }
.ui-row { height: 10px; border-radius: 99px; background: rgba(237,235,242,0.12); }
.ui-row.w60 { width: 60%; }
.ui-card { height: 17%; border-radius: 12px; background: rgba(237,235,242,0.07); }
.ui-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; flex: 1; }
.ui-grid i { border-radius: 9px; background: rgba(237,235,242,0.08); }
.ui-grid i:nth-child(2n) { background: rgba(139,95,255,0.16); }

.case__kicker { font-size: var(--text-xs); color: var(--muted); margin-bottom: 0.9rem; }
.case__text h3 { font-size: var(--text-xl); margin-bottom: 1.6rem; max-width: 18ch; }

.case__facts { display: flex; flex-direction: column; gap: 1.1rem; }
.case__facts dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.case__facts dd { color: var(--muted); font-size: var(--text-sm); line-height: 1.7; max-width: 56ch; }

.chips {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.6rem;
}
.chips li {
  font-size: var(--text-xs);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  transition: border-color 0.25s, color 0.25s;
}
.chips li:hover { border-color: var(--accent); color: var(--ink); }

/* more grid */
.more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  padding: 3rem 0 0;
}
.more__card {
  position: relative;
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform 0.4s var(--ease-out), border-color 0.3s;
}
a.more__card:hover { transform: translateY(-5px); border-color: var(--accent); }
.more__tag { font-size: var(--text-xs); color: var(--amber); }
.more__card h4 { font-size: 1.2rem; margin: 0.7rem 0 0.5rem; }
.more__card p { color: var(--muted); font-size: var(--text-sm); line-height: 1.65; }
.more__arrow { position: absolute; top: 1.3rem; right: 1.4rem; color: var(--accent); }

/* ---------- Gradle stack ---------- */
.gradle {
  background: var(--bg-code);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.9;
}
.gradle .k { color: var(--accent); }
.gradle .f { color: #6EC7FF; }
.gradle .s { color: var(--amber); }
.gradle .c { color: #5E5670; }

/* ---------- Contact ---------- */
.contact { text-align: center; padding-bottom: var(--space-section); }
.contact__kicker { font-size: var(--text-sm); color: var(--muted); margin-bottom: 1.6rem; }
.contact__title { font-size: var(--text-hero); margin: 0 auto 2.8rem; max-width: 14ch; }

.contact__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.9rem; }
.btn {
  display: inline-flex; align-items: center;
  padding: 1rem 1.8rem;
  border-radius: 99px;
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 40px -12px rgba(139, 95, 255, 0.6);
}
.btn--primary:hover { box-shadow: 0 16px 50px -10px rgba(139, 95, 255, 0.75); }
.btn--ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn--ghost:hover { color: var(--ink); border-color: var(--accent); }

.contact__links {
  margin-top: 3rem;
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 2rem;
  font-size: var(--text-sm);
  color: var(--muted);
}
.contact__links a { transition: color 0.25s; }
.contact__links a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
  padding: 1.6rem var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-xs);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 1.6rem; left: 50%;
  transform: translate(-50%, calc(100% + 2.5rem));
  opacity: 0;
  pointer-events: none;
  background: var(--bg-elev);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 0.7rem 1.3rem;
  border-radius: 99px;
  font-size: var(--text-sm);
  transition: transform 0.45s var(--ease-out), opacity 0.3s;
  z-index: 60;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .log { grid-template-columns: 1fr; gap: 0.4rem; padding: 1.4rem 1.2rem; }
  .log__time { flex-direction: row; align-items: baseline; gap: 0.7rem; }
  .case, .case--flip { grid-template-columns: 1fr; }
  .case--flip .case__media { order: 0; }
  .hero__scroll { display: none; }
  .about__intro { grid-template-columns: 1fr; justify-items: center; }
  .about__photo img { max-width: 260px; }
}

@media (max-width: 560px) {
  .nav { padding: 0.9rem 1.1rem; gap: 0.8rem; }
  .nav__brand-text { display: none; } /* mark only, status keeps room */
  .nav__mark { width: 30px; height: 30px; }
  .hero { padding-top: 6.5rem; }
  .hero__code pre { font-size: 0.74rem; }
  .hero__meta { gap: 1.2rem 1.8rem; }
  .stat span { max-width: 12ch; }
  .section__head h2 { font-size: clamp(1.6rem, 8vw, 2.2rem); }
  .case__media { padding: 1.6rem 1rem; }
  .case__text h3 { font-size: clamp(1.45rem, 7vw, 2rem); }
  .gradle { font-size: 0.72rem; line-height: 1.8; }
  .contact__title { font-size: clamp(2rem, 10vw, 3rem); }
  .contact__actions { flex-direction: column; align-items: stretch; padding: 0 0.5rem; }
  .btn { justify-content: center; }
  .contact__links { gap: 1.2rem; }
  .footer { flex-direction: column; text-align: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__title .word { transform: none; animation: none; }
  .marquee__track { animation: none; flex-wrap: wrap; width: auto; padding-left: var(--gutter); }
  .caret { animation: none; }
  .about__photo { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
