/* =========================================================
   Rahul Prajapati — Portfolio
   "Soft Light" — warm, editorial, calm. Content first.
   ========================================================= */

:root {
  color-scheme: light;

  /* Palette */
  --bg:        #FDFAF7;
  --bg-warm:   #FBF5F0;
  --card:      #FFFFFF;
  --ink:       #17130F;
  --muted:     #6E655C;
  --faint:     #A79C92;
  --line:      rgba(23, 19, 15, 0.09);
  --line-str:  rgba(23, 19, 15, 0.18);

  --accent:      #FF6A45;   /* coral — signature */
  --accent-deep: #C4462A;   /* accessible coral for small text */
  --accent-soft: #FFEDE6;
  --accent-2:    #FFB59E;

  /* Type */
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Rhythm */
  --maxw: 1180px;
  --gutter: clamp(22px, 5vw, 48px);
  --r: 24px;
  --r-sm: 16px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 12px 30px -24px rgba(23, 19, 15, 0.5);
  --shadow: 0 24px 60px -40px rgba(23, 19, 15, 0.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.62;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Soft blooms — the only ambient decoration */
.bloom { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; z-index: 0; }
.bloom--a {
  width: min(680px, 70vw); aspect-ratio: 1; top: -280px; right: -180px;
  background: radial-gradient(circle, rgba(255, 106, 69, 0.18), transparent 68%);
}
.bloom--b {
  width: min(560px, 62vw); aspect-ratio: 1; top: 520px; left: -240px;
  background: radial-gradient(circle, rgba(255, 181, 158, 0.24), transparent 68%);
}
main, .nav, .footer { position: relative; z-index: 1; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* Layout */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding: clamp(72px, 10vw, 128px) 0 0; }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: var(--maxw); margin-inline: auto;
  padding: 18px var(--gutter);
  background: rgba(253, 250, 247, 0.82); backdrop-filter: blur(14px);
}
.nav::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
  height: 1px; background: var(--line); opacity: 0; transition: opacity 0.3s;
}
.nav.is-stuck::after { opacity: 1; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
.brand i { color: var(--accent); font-style: normal; }
.nav__links { display: flex; gap: clamp(16px, 2.4vw, 32px); font-size: 15px; color: var(--muted); }
.nav__links a { position: relative; padding: 4px 0; transition: color 0.2s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 0;
  background: var(--accent); transition: width 0.25s var(--ease);
}
.nav__links a:hover, .nav__links a.is-active { color: var(--ink); }
.nav__links a:hover::after, .nav__links a.is-active::after { width: 100%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 100px; font-weight: 700; font-size: 15px;
  border: 1.5px solid transparent; transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--accent); color: #fff; box-shadow: 0 12px 28px -12px rgba(255, 106, 69, 0.8); }
.btn--solid:hover { box-shadow: 0 18px 34px -14px rgba(255, 106, 69, 0.9); }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--line-str); }
.btn--sm { padding: 10px 20px; font-size: 14px; }

.nav__burger { display: none; background: none; border: 0; cursor: pointer; width: 42px; height: 42px; flex-direction: column; gap: 6px; align-items: center; justify-content: center; }
.nav__burger span { width: 22px; height: 2px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.2s; }
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(30px, 4.5vw, 60px); align-items: center; padding: clamp(26px, 4vw, 52px) 0 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 8px 15px; border-radius: 100px; margin-bottom: 24px;
}
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; animation: pulse 2.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.5rem, 5.2vw, 3.9rem); line-height: 1.04; letter-spacing: -0.035em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lede { font-size: clamp(1.02rem, 1.5vw, 1.16rem); color: var(--muted); margin-top: 22px; max-width: 540px; }
.hero__cta { display: flex; gap: 11px; margin-top: 32px; flex-wrap: wrap; }

/* Portrait — soft rounded card with a corner badge */
.shot { position: relative; max-width: 340px; justify-self: end; width: 100%; }
.shot img {
  width: 100%; aspect-ratio: 5 / 6; object-fit: cover; object-position: 50% 14%;
  border-radius: 26px; border: 1px solid var(--line);
  box-shadow: 0 30px 62px -32px rgba(23, 19, 15, 0.4), 0 0 0 7px rgba(255, 106, 69, 0.055);
}
.shot__badge {
  position: absolute; right: -14px; bottom: -14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  padding: 11px 16px; box-shadow: 0 18px 36px -18px rgba(23, 19, 15, 0.32);
}
.shot__badge b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 15.5px; letter-spacing: -0.012em; }
.shot__badge span { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: clamp(32px, 4.5vw, 52px); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px 22px; transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.stat b { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.85rem, 3vw, 2.4rem); letter-spacing: -0.035em; display: block; line-height: 1.05; }
.stat span { font-size: 13.5px; color: var(--muted); display: block; margin-top: 4px; }

/* =========================================================
   SECTION HEADS
   ========================================================= */
.kicker { font-family: var(--font-mono); font-size: 12px; color: var(--accent-deep); letter-spacing: 0.1em; text-transform: uppercase; }
.section h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 3.6vw, 2.7rem); letter-spacing: -0.032em; margin-top: 10px; }
.section__sub { color: var(--muted); margin-top: 12px; max-width: 580px; }
.ethos {
  margin-top: 20px; max-width: 660px; padding-left: 18px;
  border-left: 2.5px solid var(--accent); color: var(--ink);
}
.ethos strong { color: var(--accent-deep); }

/* =========================================================
   STRENGTHS
   ========================================================= */
.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 38px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 30px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-str); }
.card h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.card__metric { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-deep); margin-top: 8px; }
.card ul { list-style: none; margin-top: 18px; display: grid; gap: 10px; }
.card ul li { position: relative; padding-left: 24px; color: var(--muted); font-size: 0.95rem; }
.card ul li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent-soft); border: 1.5px solid var(--accent);
}

/* Concept glyphs */
.card__glyph { width: 44px; height: 44px; margin-bottom: 16px; }
.card__glyph svg { width: 100%; height: 100%; display: block; overflow: visible; }
.card__glyph circle { fill: none; }
.card__glyph .g-core { fill: var(--accent); stroke: var(--accent); }
.card__glyph .g-scatter { stroke: var(--faint); }
.card__glyph .g-gate { stroke: var(--accent); }
.card__glyph .g-order, .card__glyph .g-branch, .card__glyph .g-choose { stroke: var(--accent-deep); }
.card__glyph .g-flag { stroke: #D64545; }
.card__glyph .g-reject { stroke: var(--faint); }
.card__glyph .g-order, .card__glyph .g-scatter { opacity: 0.85; transition: opacity 0.5s var(--ease); }
.card:hover .card__glyph .g-order { opacity: 1; }
.card__glyph [data-draw] { stroke-dasharray: 96; stroke-dashoffset: 0; }
.card:hover .card__glyph [data-draw] { animation: glyph-draw 0.85s var(--ease) both; }
@keyframes glyph-draw { from { stroke-dashoffset: 96; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .card:hover .card__glyph [data-draw] { animation: none; } }

/* =========================================================
   CASE STUDIES — numbered entries, outcome in the margin
   ========================================================= */
.cases { margin-top: 34px; border-top: 1px solid var(--line); }
.case {
  display: grid; grid-template-columns: 52px 1fr 240px; gap: clamp(20px, 3vw, 40px);
  padding: 32px 0; border-bottom: 1px solid var(--line); align-items: start;
}
.case__num { font-family: var(--font-mono); font-size: 12px; color: var(--faint); padding-top: 7px; }
.case__tag {
  display: inline-block; font-family: var(--font-mono); font-size: 11.5px;
  color: var(--accent-deep); background: var(--accent-soft); padding: 5px 11px; border-radius: 100px;
}
.case h3 { font-family: var(--font-display); font-size: clamp(1.28rem, 2.1vw, 1.6rem); font-weight: 700; letter-spacing: -0.025em; margin: 13px 0 0; line-height: 1.18; }
.case__body { margin-top: 12px; display: grid; gap: 9px; max-width: 640px; }
.case__body p { color: var(--muted); font-size: 15.5px; }
.case__body b { color: var(--ink); font-weight: 700; }
.case__out { display: grid; gap: 14px; }
.case__out div b { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; letter-spacing: -0.03em; display: block; line-height: 1.1; color: var(--accent-deep); }
.case__out div span { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.03em; }

/* =========================================================
   TOOLKIT
   ========================================================= */
.legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 18px; font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.dots { display: inline-flex; gap: 3px; }
.dots b { width: 6px; height: 6px; border-radius: 50%; background: var(--line-str); display: block; }
.dots[data-lvl="3"] b, .chip[data-lvl="3"] .dots b { background: var(--accent); }
.dots[data-lvl="2"] b:nth-child(-n+2), .chip[data-lvl="2"] .dots b:nth-child(-n+2) { background: var(--accent); }
.dots[data-lvl="1"] b:first-child, .chip[data-lvl="1"] .dots b:first-child { background: var(--accent); }

.stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; }
.stack-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; }
.stack-card h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 16px; }
.chips { list-style: none; display: grid; gap: 9px; }
.chip { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--muted); }
.stack-foot { margin-top: 22px; display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.stack-foot b { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-right: 8px; }

/* =========================================================
   PROJECTS
   ========================================================= */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.project {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.project:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-str); }
.project__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.project h3 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; }
.project__arrow { color: var(--accent); font-size: 1.05rem; }
.badge { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-deep); background: var(--accent-soft); padding: 4px 9px; border-radius: 100px; }
.project__tags { font-family: var(--font-mono); font-size: 11.5px; color: var(--faint); }
.project p { color: var(--muted); font-size: 14.8px; }
.project__link { margin-top: auto; padding-top: 10px; font-size: 14px; font-weight: 700; color: var(--accent-deep); }
.project__link--muted { color: var(--faint); font-weight: 400; }

/* =========================================================
   ABOUT
   ========================================================= */
.about { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(28px, 4vw, 56px); margin-top: 34px; align-items: start; }
.about__story { display: grid; gap: 16px; max-width: 620px; }
.about__story p { color: var(--muted); }
.about__highlight { color: var(--ink) !important; font-size: 1.08rem; padding-left: 18px; border-left: 2.5px solid var(--accent); }
.about__facts { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; }
.about__facts div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.about__facts div:last-child { border-bottom: 0; padding-bottom: 0; }
.about__facts div:first-child { padding-top: 0; }
.about__facts dt { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.about__facts dd { font-size: 14.5px; color: var(--ink); }

/* =========================================================
   CONTACT
   ========================================================= */
.contact {
  margin-top: clamp(72px, 10vw, 128px);
  background: linear-gradient(150deg, var(--accent-soft), var(--bg-warm));
  border: 1px solid var(--line); border-radius: clamp(24px, 3vw, 34px);
  padding: clamp(40px, 6vw, 72px);
  text-align: center;
}
.contact h2 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.034em; }
.contact p { color: var(--muted); margin: 14px auto 0; max-width: 520px; }
.contact__mail {
  display: inline-block; margin-top: 26px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem); letter-spacing: -0.02em;
  border-bottom: 2px solid var(--accent); padding-bottom: 3px;
}
.contact__links { display: flex; gap: 11px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

.footer { padding: 40px var(--gutter) 44px; text-align: center; color: var(--faint); font-size: 13.5px; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; }
  .shot { max-width: 290px; justify-self: start; }
  .shot__badge { right: 0; bottom: -12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .bento, .stack { grid-template-columns: 1fr; }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .case { grid-template-columns: 40px 1fr; }
  .case__out { grid-column: 2; display: flex; gap: 28px; }
}
@media (max-width: 760px) {
  .nav__links {
    position: fixed; inset: 66px 0 auto; flex-direction: column; gap: 4px;
    background: var(--bg); padding: 18px var(--gutter) 26px; border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform 0.35s var(--ease); font-size: 17px;
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { padding: 11px 0; }
  .nav__burger { display: flex; }
  .nav .btn { display: none; }
  .projects { grid-template-columns: 1fr; }
  .hero__cta .btn { flex: 1 1 auto; }
}
