/* ============================================================
   Ylyas Nurmuhammedov — portfolio v2
   Warm, friendly, multi-page. Native scroll, light animations.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg:        #fdfbf7;
  --bg-soft:   #f6f1e8;
  --card:      #ffffff;
  --ink:       #23212e;
  --muted:     #6f6b7d;
  --line:      #e9e3d8;

  --blue:      #4a7cff;   /* SmartTax */
  --blue-soft: #e9efff;
  --violet:    #8b5cf6;   /* Campus app */
  --violet-soft:#f1eaff;
  --green:     #1f9d61;   /* Semangoh */
  --green-soft:#e3f5eb;
  --peach:     #ff9f5a;
  --peach-soft:#fff0e2;
  --coral:     #ff6b6b;

  --f-display: "Bricolage Grotesque", sans-serif;
  --f-body:    "Inter", sans-serif;

  --r: 20px;
  --shadow: 0 12px 32px rgba(35, 33, 46, 0.08);
  --shadow-lg: 0 24px 60px rgba(35, 33, 46, 0.12);
  --pad-x: clamp(1.25rem, 5vw, 4rem);
  --maxw: 1120px;
}

/* ---------- 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(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.12; letter-spacing: -0.01em; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }

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

/* ---------- reveal on scroll (lightweight) ---------- */
.fade {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.fade.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .fade { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.9rem var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex; align-items: center; gap: 0.55rem;
}
.logo__mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--peach), var(--coral));
  color: #fff;
  display: grid; place-items: center;
  font-size: 0.85rem;
  font-weight: 800;
}
.site-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); font-weight: 500; font-size: 0.95rem; }
.site-nav a { color: var(--muted); padding: 0.3rem 0.1rem; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); border-bottom-color: var(--peach); }
.btn-nav {
  background: var(--ink);
  color: #fff !important;
  padding: 0.55rem 1.15rem !important;
  border-radius: 999px;
  border-bottom: none !important;
  transition: transform 0.2s, background 0.2s;
}
.btn-nav:hover { background: #3a3748; transform: translateY(-1px); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: 0.25s; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 1rem var(--pad-x) 1.4rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.6rem 0; border-bottom: none; }
  .btn-nav { text-align: center; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn--primary { background: var(--ink); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn--ghost { border: 1.5px solid var(--line); background: var(--card); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- pills / tags ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
}
.pill--blue   { background: var(--blue-soft);   color: var(--blue); }
.pill--violet { background: var(--violet-soft); color: var(--violet); }
.pill--green  { background: var(--green-soft);  color: var(--green); }
.pill--peach  { background: var(--peach-soft);  color: #d97a2e; }

/* ---------- section scaffold ---------- */
.section { padding: clamp(3.5rem, 9vh, 6rem) 0; }
.section--soft { background: var(--bg-soft); }
.section-head { max-width: 640px; margin-bottom: clamp(2rem, 5vh, 3.2rem); }
.section-head .kicker {
  display: inline-block;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--peach);
  margin-bottom: 0.7rem;
}
.section-head h2 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); font-weight: 700; }
.section-head p { color: var(--muted); margin-top: 0.8rem; }

/* ============================================================
   HOME — hero
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 7vh, 5.5rem) 0 clamp(2.5rem, 6vh, 4.5rem);
}
/* slow-rotating aurora behind the hero (pre-blurred gradients — no filter, cheap) */
.hero::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 150%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(32% 32% at 28% 30%, rgba(255, 214, 165, 0.55) 0%, transparent 70%),
    radial-gradient(30% 30% at 74% 24%, rgba(214, 196, 255, 0.5) 0%, transparent 70%),
    radial-gradient(36% 36% at 70% 74%, rgba(186, 235, 207, 0.5) 0%, transparent 70%),
    radial-gradient(26% 26% at 28% 78%, rgba(255, 199, 190, 0.5) 0%, transparent 70%);
  border-radius: 50%;
  animation: aurora-spin 36s linear infinite;
  will-change: transform;
  pointer-events: none;
}
@keyframes aurora-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .hero::before { animation: none; } }

/* scroll progress bar */
.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  z-index: 60;
  background: linear-gradient(90deg, var(--peach), var(--coral), var(--violet), var(--blue));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

/* ---------- AI sidekick robot ---------- */
.bot {
  position: absolute;
  left: -76px; bottom: -14px;
  width: 128px;
  z-index: 2;
  filter: drop-shadow(0 14px 22px rgba(35, 33, 46, 0.18));
  animation: bot-bob 4.5s ease-in-out infinite;
}
@keyframes bot-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.bot__bubble {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 24px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  box-shadow: var(--shadow);
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  min-height: 2.1em;
}
.bot__caret {
  display: inline-block;
  width: 2px; height: 0.95em;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: -0.12em;
  animation: caret-blink 0.9s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.bot__tip { animation: tip-pulse 1.5s ease-in-out infinite; }
@keyframes tip-pulse { 50% { opacity: 0.3; } }
.bot__core { animation: core-pulse 2.4s ease-in-out infinite; transform-origin: 60px 100px; }
@keyframes core-pulse {
  0%, 100% { transform: scale(1); fill: #8b5cf6; }
  50%      { transform: scale(1.25); fill: #ff6b6b; }
}
.bot__arm {
  transform-origin: 93px 82px;
  animation: bot-wave 3.4s ease-in-out infinite;
}
@keyframes bot-wave {
  0%, 50%, 100% { transform: rotate(0deg); }
  60% { transform: rotate(-38deg); }
  70% { transform: rotate(-10deg); }
  80% { transform: rotate(-38deg); }
}
@media (max-width: 860px) {
  .bot { left: auto; right: -14px; bottom: -16px; width: 88px; }
  .bot__bubble { left: auto; right: 18px; border-radius: 14px 14px 4px 14px; font-size: 0.72rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bot, .bot__arm, .bot__core, .bot__tip { animation: none; }
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__grid .hero__photo { order: -1; max-width: 280px; }
}

.hero__hello {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1.05rem;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.4rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero h1 .hl {
  background: linear-gradient(90deg, var(--blue), var(--violet), var(--coral), var(--blue));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hue-slide 7s linear infinite;
}
@keyframes hue-slide { to { background-position: -300% 0; } }
.hero__sub { color: var(--muted); font-size: 1.1rem; margin-top: 1.2rem; max-width: 34em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

.hero__social { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2.4rem; }
.social-chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.93rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.social-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink); }
.social-chip img { width: 18px; height: 18px; }

.hero__photo { position: relative; justify-self: center; width: 100%; max-width: 400px; }
.hero__photo img {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  object-position: 50% 62%;
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__photo:hover img { transform: rotate(-2deg) scale(1.03); }
.hero__photo::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 40px;
  background: linear-gradient(140deg, var(--peach), var(--coral) 45%, var(--violet));
  opacity: 0.18;
  z-index: -1;
}

/* ============================================================
   project cards (home + work page)
   ============================================================ */
.cards { display: grid; gap: 1.5rem; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .cards--3 { grid-template-columns: 1fr; } }

.pcard {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}
.pcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.pcard__art {
  height: 168px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.pcard__art svg { width: 76%; height: auto; max-height: 78%; }
.pcard--blue   .pcard__art { background: linear-gradient(135deg, var(--blue-soft), #f5f8ff); }
.pcard--violet .pcard__art { background: linear-gradient(135deg, var(--violet-soft), #f9f6ff); }
.pcard--green  .pcard__art { background: linear-gradient(135deg, var(--green-soft), #f2fbf6); }

.pcard__body { padding: 1.5rem 1.5rem 1.7rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.pcard__meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pcard h3 { font-size: 1.35rem; font-weight: 700; }
.pcard p { color: var(--muted); font-size: 0.97rem; flex: 1; }
.pcard__go {
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-block;
  position: relative;
  align-self: flex-start;
}
.pcard--blue .pcard__go { color: var(--blue); }
.pcard--violet .pcard__go { color: var(--violet); }
.pcard--green .pcard__go { color: var(--green); }
.pcard__go::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 2px;
  background: currentColor;
  transform: scaleX(0.35);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.pcard:hover .pcard__go::after, .work-row:hover .pcard__go::after { transform: scaleX(1); }

/* ============================================================
   badges strip
   ============================================================ */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 760px) { .badges { grid-template-columns: 1fr; } }
.badge-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.6rem;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.badge-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.badge-card img { width: 120px; margin: 0 auto 1rem; }
.badge-card h3 { font-size: 1.02rem; font-weight: 700; }
.badge-card span { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.3rem; }

/* ============================================================
   quote / vision teaser
   ============================================================ */
.vision-teaser {
  background: var(--ink);
  color: #fff;
  border-radius: calc(var(--r) + 8px);
  padding: clamp(2.2rem, 6vw, 3.8rem);
  position: relative;
  overflow: hidden;
}
.vision-teaser::after {
  content: "";
  position: absolute;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 159, 90, 0.35), transparent 70%);
  top: -120px; right: -80px;
}
.vision-teaser .kicker { color: var(--peach); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; }
.vision-teaser blockquote {
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  font-weight: 600;
  line-height: 1.4;
  margin: 1rem 0 1.6rem;
  max-width: 26em;
}
.vision-teaser .btn--light { background: #fff; color: var(--ink); }
.vision-teaser .btn--light:hover { transform: translateY(-2px); }

/* ============================================================
   contact CTA + footer
   ============================================================ */
.contact { text-align: center; }
.contact h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
.contact p { color: var(--muted); max-width: 32em; margin: 1rem auto 0; }
.contact .btn { margin-top: 2rem; }
.contact__links { display: flex; justify-content: center; gap: 1.6rem; margin-top: 1.8rem; font-weight: 600; font-size: 0.95rem; }
.contact__links a { color: var(--muted); transition: color 0.2s; }
.contact__links a:hover { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem var(--pad-x);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ============================================================
   ABOUT page
   ============================================================ */
.about-hero { display: grid; grid-template-columns: 380px 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: stretch; }
@media (max-width: 820px) { .about-hero { grid-template-columns: 1fr; align-items: start; } .about-hero__photo { max-width: 320px; } .about-hero__photo img { height: auto; aspect-ratio: 4/5.6; } }
.about-hero__photo img {
  width: 100%;
  height: 88%;
  border-radius: 28px;
  object-fit: cover;
  object-position: 50% 78%;
  box-shadow: var(--shadow-lg);
}
.about-hero h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 800; }
.about-hero .lede { font-size: 1.15rem; color: var(--muted); margin-top: 1rem; }
.about-hero .body-text p { margin-top: 1rem; color: var(--ink); }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
@media (max-width: 920px) { .pillars { grid-template-columns: 1fr; } }
.pillar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.8rem 1.6rem;
  transition: transform 0.25s, box-shadow 0.25s;
}
.pillar:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.pillar__icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.pillar:nth-child(1) .pillar__icon { background: var(--blue-soft); }
.pillar:nth-child(2) .pillar__icon { background: var(--green-soft); }
.pillar:nth-child(3) .pillar__icon { background: var(--peach-soft); }
.pillar h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.6rem; }
.pillar p { color: var(--muted); font-size: 0.95rem; }

/* grouped toolbox (about page) */
.toolbox-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
  align-items: start;
}
@media (max-width: 920px) { .toolbox-groups { grid-template-columns: 1fr; } }

.toolbox-group {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 2rem 1.8rem 2.1rem;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1), box-shadow 0.28s, border-color 0.28s;
}
/* colored glow accent in the corner of each card */
.toolbox-group::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 150px; height: 150px;
  border-radius: 50%;
  opacity: 0.5;
  transition: opacity 0.3s, transform 0.45s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
}
/* top accent bar */
.toolbox-group::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.toolbox-group:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.toolbox-group:hover::before { opacity: 0.8; transform: scale(1.15); }

.toolbox-group--blue::before  { background: radial-gradient(circle, rgba(74,124,255,0.35), transparent 70%); }
.toolbox-group--blue::after   { background: linear-gradient(90deg, var(--blue), #9db8ff); }
.toolbox-group--green::before { background: radial-gradient(circle, rgba(31,157,97,0.32), transparent 70%); }
.toolbox-group--green::after  { background: linear-gradient(90deg, var(--green), #5fd39b); }
.toolbox-group--peach::before { background: radial-gradient(circle, rgba(255,159,90,0.4), transparent 70%); }
.toolbox-group--peach::after  { background: linear-gradient(90deg, var(--peach), var(--coral)); }

.toolbox-group__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.7rem;
}
.toolbox-group__icon {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow);
}
.toolbox-group--blue  .toolbox-group__icon { background: var(--blue-soft); }
.toolbox-group--green .toolbox-group__icon { background: var(--green-soft); }
.toolbox-group--peach .toolbox-group__icon { background: var(--peach-soft); }
.toolbox-group__head h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.2; }
.toolbox-group__sub { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 500; margin-top: 0.15rem; }

/* vision intro lead-in */
.vision-lead { max-width: 760px; margin-bottom: 2.4rem; }
.vision-lead p { color: #3c3947; }
.vision-lead p + p { margin-top: 1rem; }

.skills-row { display: flex; flex-wrap: wrap; gap: 0.65rem; position: relative; z-index: 1; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.skill-chip:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: var(--shadow);
  background: var(--card);
  border-color: var(--ink);
}
.skill-chip img { width: 18px; height: 18px; }
/* chips inside a category card sit on white, lift with the card's accent */
.toolbox-group .skill-chip { background: var(--bg); }
.toolbox-group--blue  .skill-chip:hover { border-color: var(--blue); }
.toolbox-group--green .skill-chip:hover { border-color: var(--green); }
.toolbox-group--peach .skill-chip:hover { border-color: var(--peach); }

.xp-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.7rem 1.8rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: start;
}
.xp-card + .xp-card { margin-top: 1rem; }
.xp-card__icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.25rem;
  background: var(--bg-soft);
}
.xp-card h3 { font-size: 1.12rem; font-weight: 700; }
.xp-card .where { color: var(--muted); font-size: 0.92rem; margin-top: 0.15rem; }
.xp-card p { color: var(--muted); font-size: 0.95rem; margin-top: 0.6rem; }

/* ============================================================
   CASE STUDY pages
   ============================================================ */
.case-hero { padding: clamp(2.5rem, 7vh, 4.5rem) 0 clamp(2rem, 5vh, 3rem); }
.case-hero .back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--muted); font-weight: 600; font-size: 0.92rem;
  margin-bottom: 1.6rem;
  transition: color 0.2s;
}
.case-hero .back:hover { color: var(--ink); }
.case-hero__tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.case-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; }
.case-hero .lede { font-size: 1.18rem; color: var(--muted); margin-top: 1.1rem; max-width: 38em; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.2rem;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--r);
  padding: 1.4rem 1.6rem;
}
@media (max-width: 760px) { .case-meta { grid-template-columns: repeat(2, 1fr); } }
.case-meta div span { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.case-meta div strong { font-size: 0.98rem; font-weight: 600; }

.case-body { max-width: 760px; }
.case-body h2 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 700;
  margin: 2.8em 0 0.8em;
}
.case-body h2:first-child { margin-top: 0; }
.case-body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.8em 0 0.5em; }
.case-body p { margin: 0.9em 0; color: #3c3947; }
.case-body ul { margin: 0.9em 0 0.9em 1.2em; color: #3c3947; }
.case-body li { margin: 0.45em 0; }

.callout {
  border-radius: var(--r);
  padding: 1.4rem 1.6rem;
  margin: 1.6em 0;
  border: 1px solid var(--line);
}
.callout--blue   { background: var(--blue-soft);   border-color: #d4e0ff; }
.callout--violet { background: var(--violet-soft); border-color: #e2d6ff; }
.callout--green  { background: var(--green-soft);  border-color: #c9ecd9; }
.callout--peach  { background: var(--peach-soft);  border-color: #ffdfc2; }
.callout strong { font-weight: 700; }
.callout p { margin: 0.4em 0 0; }

/* decision blocks */
.decision { border-left: 3px solid var(--line); padding: 0.2rem 0 0.2rem 1.3rem; margin: 1.6em 0; }
.case--blue   .decision { border-color: var(--blue); }
.case--violet .decision { border-color: var(--violet); }
.case--green  .decision { border-color: var(--green); }
.decision h3 { margin: 0 0 0.35em; }
.decision p { margin: 0.5em 0; }

/* flow diagram (SmartTax pipeline) */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
  margin: 1.6em 0;
}
.flow__step {
  flex: 1 1 100px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  display: flex; flex-direction: column; gap: 0.25rem; justify-content: center;
  position: relative;
}
.flow__step em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.flow__n {
  width: 24px; height: 24px;
  margin: 0 auto 0.2rem;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: grid; place-items: center;
}
.flow__step--hi { background: var(--blue-soft); border-color: #d4e0ff; }
.flow__step--hi .flow__n { background: var(--blue); }

/* stat chips (tests breakdown etc.) */
.stat-chips { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.4em 0; }
.stat-chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 1.2rem;
  text-align: center;
}
.stat-chip strong { display: block; font-family: var(--f-display); font-size: 1.45rem; font-weight: 800; }
.stat-chip span { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

/* sensor / feature mini-cards */
.mini-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.4em 0; }
@media (max-width: 700px) { .mini-cards { grid-template-columns: 1fr; } }
.mini-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
}
.mini-card .ic { font-size: 1.4rem; }
.mini-card h4 { font-size: 0.98rem; font-weight: 700; margin: 0.5rem 0 0.3rem; }
.mini-card p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* stack icon row */
.stack-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.2em 0 0; }

/* outcome panel */
.outcome {
  border-radius: var(--r);
  padding: 1.6rem 1.8rem;
  margin: 1.6em 0;
  color: #fff;
}
.case--blue   .outcome { background: linear-gradient(135deg, var(--blue), #6e96ff); }
.case--violet .outcome { background: linear-gradient(135deg, var(--violet), #a98bff); }
.case--green  .outcome { background: linear-gradient(135deg, var(--green), #3cba7e); }
.outcome h2 { color: #fff; margin: 0 0 0.5em !important; }
.outcome p { color: rgba(255,255,255,0.92) !important; margin: 0.5em 0; }

/* next-project footer */
.next-case {
  margin-top: clamp(3rem, 8vh, 5rem);
  border-top: 1px solid var(--line);
  padding-top: 2.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.next-case span { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.next-case a {
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  border-bottom: 3px solid var(--peach);
  transition: color 0.25s, border-color 0.25s;
}
.next-case a:hover { color: var(--coral); border-color: var(--coral); }

/* work page list */
.work-list { display: flex; flex-direction: column; gap: 1.8rem; }
.work-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s;
}
.work-row:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
@media (max-width: 820px) { .work-row { grid-template-columns: 1fr; } .work-row .pcard__art { height: 150px; } }
.work-row .pcard__art { height: auto; min-height: 190px; }
.work-row__body { padding: 1.8rem 2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.work-row__body h3 { font-size: 1.5rem; font-weight: 700; }
.work-row__body p { color: var(--muted); }

/* ============================================================
   STORY — "The Leap of Faith" (about page)
   ============================================================ */
.story { position: relative; max-width: 740px; }
.story::before {
  content: "";
  position: absolute;
  left: 25px; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--peach), var(--coral), var(--violet), var(--blue), var(--green));
  opacity: 0.55;
}
.story-ch {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.4rem;
  padding: 1.6rem 0;
}
.story-ch__n {
  width: 52px; height: 52px;
  border-radius: 18px;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow);
}
.story-ch--1 .story-ch__n { background: linear-gradient(135deg, var(--peach), var(--coral)); }
.story-ch--2 .story-ch__n { background: linear-gradient(135deg, var(--coral), var(--violet)); }
.story-ch--3 .story-ch__n { background: linear-gradient(135deg, var(--violet), var(--blue)); }
.story-ch--4 .story-ch__n { background: linear-gradient(135deg, var(--blue), var(--green)); }
.story-ch--5 .story-ch__n { background: linear-gradient(135deg, var(--green), var(--peach)); }
.story-ch h3 { font-size: 1.45rem; font-weight: 700; margin-bottom: 0.6rem; }
.story-ch p { color: #3c3947; margin: 0.7em 0; }
.story-ch p:first-of-type { margin-top: 0; }

.story-quote {
  position: relative;
  z-index: 1;
  margin: 1.6rem 0 1.6rem 0;
  background: var(--ink);
  color: #fff;
  border-radius: calc(var(--r) + 4px);
  padding: clamp(1.8rem, 5vw, 2.6rem);
  font-family: var(--f-display);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 600;
  line-height: 1.45;
  overflow: hidden;
}
.story-quote::after {
  content: "";
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.4), transparent 70%);
  bottom: -110px; right: -70px;
}
.story-quote .who { display: block; margin-top: 1rem; font-family: var(--f-body); font-size: 0.85rem; font-weight: 600; color: var(--peach); }

@media (max-width: 640px) {
  .story::before { left: 19px; }
  .story-ch { grid-template-columns: 40px 1fr; gap: 1rem; }
  .story-ch__n { width: 40px; height: 40px; border-radius: 13px; font-size: 0.85rem; }
}

/* ============================================================
   STORY TEASER (home)
   ============================================================ */
.story-teaser {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  background: linear-gradient(120deg, #fff4e6, #ffe9e4 45%, #f3ecff);
  border: 1px solid #ffe3c8;
  border-radius: calc(var(--r) + 8px);
  padding: clamp(1.8rem, 5vw, 3rem);
  overflow: hidden;
}
@media (max-width: 720px) { .story-teaser { grid-template-columns: 1fr; } }
.story-teaser__flag {
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
}
.story-teaser__flag small { font-size: 0.78rem; font-weight: 700; color: #b07c4f; letter-spacing: 0.08em; }
.story-teaser h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; }
.story-teaser p { color: #6b5d52; margin-top: 0.8rem; max-width: 36em; }
.story-teaser .btn { margin-top: 1.4rem; }

/* ============================================================
   INTERACTION LAYER — 3D tilt, glare, magnetic, count-up, stagger
   (progressively enhanced; all gated behind hover + motion prefs)
   ============================================================ */

/* count-up stat: hold layout steady while the number animates */
.stat-chip strong[data-count] { font-variant-numeric: tabular-nums; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  /* cards that opt into 3D tilt */
  .tilt {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
    will-change: transform;
  }
  /* JS drives this var on hover; cleared on leave so the lift eases back */
  .tilt.is-tilting {
    transition: transform 0.08s linear, box-shadow 0.3s ease;
    box-shadow: var(--shadow-lg);
  }
  /* moving light sheen that tracks the cursor */
  .tilt-glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(
      240px circle at var(--gx, 50%) var(--gy, 50%),
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0) 62%
    );
    mix-blend-mode: soft-light;
  }
  .tilt.is-tilting .tilt-glare { opacity: 1; }
  /* nudge inner content forward for a touch of real depth */
  .tilt > *:not(.tilt-glare) { transform: translateZ(0.01px); }

  /* magnetic elements (buttons) */
  .magnetic { will-change: transform; }
}

/* staggered reveal: JS sets --d when a batch enters together */
.fade { transition-delay: var(--d, 0s); }
