/* ==========================================================================
   Vimal Builds — components. Requires tokens.css.
   Class names match DESIGN.md. Reference markup: reference/pages/*.html
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body);
  -webkit-font-smoothing: antialiased; transition: background var(--dur-theme), color var(--dur-theme); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent-builds); outline-offset: 3px; border-radius: 6px; }

/* ---- Layout ---- */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.page { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 88px; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 900px) { .wrap { padding: 0 18px; } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g2, .g3 { grid-template-columns: 1fr; } }

/* ---- Type ---- */
.h { font-family: var(--font-head); font-weight: var(--fw-head); letter-spacing: var(--tracking-head); }
.display { font-size: var(--fs-display); line-height: 1.02; margin: 0; }
.h1p { font-size: var(--fs-h1); line-height: 1.05; margin: 0; }
.h2s { font-size: var(--fs-h2); line-height: 1.15; }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--text2); }
@media (max-width: 600px) { .h1p { font-size: 40px; } .h2s { font-size: 28px; } }

/* ---- Background glow (place as first child of a position:relative page) ---- */
.glow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.glow span { position: absolute; border-radius: 999px; }
.glow span:nth-child(1) { width: 620px; height: 620px; left: -160px; top: -220px; background: var(--blob1); filter: blur(90px); opacity: .85; }
.glow span:nth-child(2) { width: 560px; height: 560px; right: -140px; top: -120px; background: var(--blob3); filter: blur(90px); opacity: .85; }
.glow span:nth-child(3) { width: 520px; height: 520px; left: 35%; top: 300px; background: var(--blob2); filter: blur(100px); opacity: .75; }

/* ---- Header ---- */
.site-header { position: relative; z-index: 2; border-bottom: var(--border); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 5px; margin: -5px; } /* 44px tap area around the 34px mark */
.brand svg, .brand img { width: 34px; height: 34px; }
.brand .wm { font-family: var(--font-head); font-weight: 500; font-size: 21px; letter-spacing: -.02em; }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--muted); padding: 9px 16px; border-radius: var(--r-pill); font-weight: 500; font-size: 15px; text-decoration: none; }
.nav a:hover { color: var(--text); background: var(--chip); }
.nav a[aria-current="page"] { color: var(--text); background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
.theme-toggle { width: 44px; height: 44px; border-radius: var(--r-pill); border: var(--border); background: var(--surface);
  color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; }
@media (max-width: 900px) { .nav a { padding: 8px 10px; } }
@media (max-width: 600px) { .brand .wm { display: none; } .nav { max-width: calc(100vw - 130px); overflow-x: auto; scrollbar-width: none; }
  .nav a { padding: 8px 9px; font-size: 14px; } }

/* ---- Footer ---- */
.site-footer { border-top: var(--border); }
.site-footer .wrap { display: flex; justify-content: center; text-align: center; flex-wrap: wrap; gap: 12px; padding-top: 28px; padding-bottom: 32px; font-size: 14px; color: var(--muted); }

/* ---- Pill / tag ---- */
.pill { display: inline-block; font-size: var(--fs-pill); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--r-pill); }
.pill--fire { background: var(--accent-fire-deep); color: var(--on-accent); }
.pill--travel { background: var(--accent-travel); color: var(--on-terracotta); }
.pill--roadmap { background: var(--accent-roadmap); color: var(--on-mustard); }
.pill--quiet { background: var(--chip); color: var(--muted); }
.tech-tag { font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: var(--r-pill); background: var(--chip); color: var(--text2); }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 22px;
  border-radius: var(--r-pill); border: 0; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.btn--ink { background: var(--stripe-ink); color: #fff; }
.btn--travel { background: var(--accent-travel); color: #fff; }
.btn--white { background: #fff; color: #1A1F2B; }
.segmented { display: flex; gap: 6px; background: rgba(8,36,26,.28); padding: 5px; border-radius: var(--r-pill); }
.segmented button { height: 42px; padding: 0 18px; border-radius: var(--r-pill); border: 0; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; background: transparent; color: #fff; }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--accent-fire-deep); }

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; }
.input { height: 50px; border-radius: var(--r-md); border: var(--border); background: var(--bg); color: var(--text); padding: 0 16px; font: inherit; font-size: 16px; }
.search { height: 48px; border-radius: var(--r-pill); border: var(--border); background: var(--surface); color: var(--text); padding: 0 18px 0 44px; font: inherit; font-size: 15px; width: 100%; }
.field-error { margin: -10px 0 0; font-size: 13px; color: var(--danger); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-md); background: var(--chip); font-size: 14px; line-height: 1.55; color: var(--text2); }

/* ---- Home tiles (solid accent + painting along the bottom) ---- */
.tile { position: relative; overflow: hidden; border-radius: var(--r-xl); color: #fff; display: flex; flex-direction: column; min-height: 300px;
  text-decoration: none !important; transition: transform var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease); }
.tile:hover, .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.tile--travel { background: var(--accent-travel); } .tile--fire { background: var(--accent-fire); } .tile--builds { background: var(--accent-builds); }
.tile .ico { width: 48px; height: 48px; border-radius: var(--r-md); background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; }
.tile .painting { margin-top: auto; height: 120px; opacity: .9; }

/* ---- Card (painting on top, white body) ---- */
.card { display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: var(--border);
  color: var(--text); text-decoration: none !important; transition: transform var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease); }
.card .painting { height: 190px; }           /* travel chronicles; 170px on FIRE steps & builds */
.card .body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.card .title { font-family: var(--font-head); font-weight: 500; font-size: var(--fs-h3); line-height: 1.2; letter-spacing: var(--tracking-head); }
.painting svg, .painting img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Painted hero (posts) ---- */
.hero { position: relative; height: 560px; overflow: hidden; }       /* 520px on roadmap posts */
.hero .painting { position: absolute; inset: 0; }
.hero::after { content: ""; position: absolute; inset: 0; background: var(--scrim-hero); }
.hero .wrap { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 48px; color: #fff; }
.hero h1 { margin: 0; font-family: var(--font-head); font-weight: 500; font-size: var(--fs-hero); line-height: 1.05; max-width: 15em; text-shadow: 0 2px 20px rgba(0,0,0,.25); }

/* ---- Article ---- */
.post { max-width: var(--measure); margin: 0 auto; padding: 44px 24px 72px; }
.post p, .post li { font-size: var(--fs-body-post); line-height: 1.75; color: var(--text2); }
.post p { margin: 0 0 22px; }
.post strong { color: var(--text); }
.post h2 { font-family: var(--font-head); font-weight: 500; font-size: var(--fs-h2-post); letter-spacing: var(--tracking-head); color: var(--text); margin: 52px 0 14px; line-height: 1.15; }
.post .lede { font-family: var(--font-head); font-size: 24px; line-height: 1.45; color: var(--text); }
.post .disclosure { font-size: 14px; color: var(--muted); background: var(--chip); border-radius: 12px; padding: 12px 16px; }
.post figure { margin: 0; }
.post figure img { width: 100%; border-radius: 8px; object-fit: cover; }
.post figcaption { margin-top: 8px; font-size: var(--fs-caption); color: var(--muted); text-align: center; }
.photos-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 28px 0 6px; }
.photos-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 28px 0 6px; }
@media (max-width: 600px) { .photos-2, .photos-3 { grid-template-columns: 1fr; } }

/* Tables */
.table-wrap { background: var(--surface); border: var(--border); border-radius: var(--r-lg); padding: 6px 16px; overflow-x: auto; margin: 20px 0 8px; }
.post table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.post th, .post td { padding: 10px; border-bottom: var(--border); text-align: left; color: var(--text2); vertical-align: top; }
.post tr:last-child td { border-bottom: 0; }
.post th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.post td.num, .post th.num { text-align: right; white-space: nowrap; }

/* Callouts */
.callout { border-radius: var(--r-lg); padding: 20px 22px; margin: 28px 0; }
.callout p { margin: 0 !important; font-size: 17px !important; color: var(--text) !important; }
.callout--tip { background: var(--terraBg); }        /* travel tips; label color var(--terra) */
.callout--tax { background: var(--mustBg); }         /* roadmap tips; label color var(--must) */
.callout--differently { background: var(--surface); border: 1.5px dashed var(--accent-roadmap); }
.callout--numbers { background: var(--accent-fire); color: #fff; padding: 26px; }
.callout--numbers .label { color: #D3F0E2; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.callout--numbers .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; }
.callout--numbers .value { font-family: var(--font-head); font-size: 34px; line-height: 1; color: #fff; }
.callout--numbers .value--hl { color: var(--accent-roadmap-soft); }
.callout--numbers .caption { margin-top: 6px; font-size: 13px; color: #D3F0E2; }

/* Charts (inline SVG; see DESIGN.md > Charts) */
.chart { margin: 32px 0; background: var(--surface); border: var(--border); border-radius: var(--r-xl); padding: 22px 22px 16px; }
.chart .chart-title { font-family: var(--font-head); font-weight: 500; font-size: 20px; color: var(--text); }
.chart .legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; font-family: var(--font-body); }
.chart .grid { stroke: var(--line); stroke-width: var(--stroke-grid); }
.chart .axis-label { fill: var(--muted); font-size: 12px; }
.chart .value-label { fill: var(--text); font-size: 13px; font-weight: 600; }
.chart figcaption { text-align: left; }

/* Prev / next */
.prevnext { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 48px; }
.prevnext .card { flex-direction: row; align-items: stretch; }
.prevnext .thumb { width: 120px; flex-shrink: 0; }
@media (max-width: 600px) { .prevnext { grid-template-columns: 1fr; } }

/* Empty state */
.empty { text-align: center; padding: 48px 20px; border-radius: var(--r-xl); border: var(--border-dashed); background: var(--surface); }

@media (prefers-reduced-motion: reduce) { .tile, .card { transition: none; } .tile:hover, .card:hover { transform: none; } }

/* About page */
@media (max-width: 700px) {
  .about-photo { height: auto !important; aspect-ratio: 1400 / 911; }
}
@media (max-width: 600px) {
  .about-contact { padding: 36px 24px !important; align-items: center !important; text-align: center; }
  .about-scrim { background: rgba(20,16,30,.42) !important; }
  .about-contact-text { font-size: 16px !important; text-wrap: balance; }
  .about-mail { max-width: 100%; box-sizing: border-box; padding: 13px 18px !important; gap: 8px !important; font-size: clamp(12px, 3.8vw, 15px) !important; }
  .about-mail svg { flex: none; }
}

/* Builds: whole card is the link (stretched link on the title) */
.card { position: relative; }
.card-link { color: inherit; text-decoration: none !important; }
.card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card:has(.card-link) { cursor: pointer; }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 2px solid var(--accent-builds); outline-offset: 3px; }

/* Travel cards: country badge sits on the painting, top-right */
.card .painting { position: relative; }
.pill--on-art { border: 2px solid rgba(255,255,255,.92); box-shadow: 0 4px 12px -4px rgba(20,20,40,.45); }
.card .painting .pill--on-art { position: absolute; top: 12px; right: 12px; }

/* FIRE step cards: post links with a round arrow chip */
.part-link { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); font-size: 15px; line-height: 1.4; text-decoration: none; }
.part-arrow { flex: none; width: 30px; height: 30px; border-radius: 999px; background: var(--chip); color: var(--text2); display: grid; place-items: center;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease); }
.part-link:hover .part-arrow, .part-link:focus-visible .part-arrow { background: var(--step, var(--accent-fire)); color: var(--step-ink, var(--on-accent)); transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .part-arrow { transition: none; } .part-link:hover .part-arrow { transform: none; } }

/* FIRE quote band: painted dusk sky, big mustard quote mark */
.quote-band { position: relative; margin: 56px 0 0; border-radius: var(--r-2xl); overflow: hidden; color: #fff; min-height: 300px; display: flex; align-items: center; background: #2E2A5C; }
.quote-art, .quote-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.quote-art img { object-fit: cover; display: block; }
.quote-band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,16,30,.55), rgba(20,16,30,.12) 78%), linear-gradient(180deg, rgba(20,16,30,0) 35%, rgba(20,16,30,.3)); }
.quote-body { position: relative; z-index: 1; margin: 0; padding: 48px 52px 56px; max-width: 760px; }
.quote-mark { display: block; font-family: var(--font-head); font-weight: 600; font-size: 96px; line-height: .7; height: 44px; color: var(--quote-accent, var(--accent-roadmap)); }
.quote-text { margin: 0; font-family: var(--font-head); font-weight: 500; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.25; letter-spacing: var(--tracking-head); text-shadow: 0 2px 16px rgba(0,0,0,.25); }
.quote-text em { font-style: normal; color: var(--quote-soft, #FFD36E); box-shadow: inset 0 -.14em 0 color-mix(in srgb, var(--quote-soft, #FFD36E) 55%, transparent); }
.quote-by { margin-top: 18px; font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.88); }
.quote-by::before { content: ""; display: inline-block; width: 28px; height: 2px; margin-right: 12px; vertical-align: middle; background: var(--quote-accent, var(--accent-roadmap)); }
.quote-band--travel { --quote-accent: #FF9A78; --quote-soft: #FFC9B2; background: #1F3B73; }
.quote-band--builds { --quote-accent: #9DB4FF; --quote-soft: #C9D6FF; background: #1B2350; }
@media (max-width: 600px) { .quote-art img { object-position: 8% center; } .quote-band::after { background: rgba(20,16,30,.42); } .quote-body { padding: 36px 24px 40px; } .quote-mark { font-size: 76px; height: 34px; } .quote-band { min-height: 0; } }

/* Skip link: hidden until a keyboard user tabs to it */
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 100; background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: var(--r-pill); font-size: 15px; font-weight: 600; transition: top .15s ease; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
/* Home tile descriptions: white on terracotta/green only passes contrast as large bold text */
.tile-desc { font-size: 18.7px; font-weight: 700; line-height: 1.4; max-width: 20em; }

/* FIRE step cards: same look as .card, and where subgrid exists the pill, title, text and part list line up across all three cards */
.step-card { display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden; background: var(--surface); border: var(--border); }
.step-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
@supports (grid-template-rows: subgrid) {
  .step-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; }
  .step-body { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 10px; align-content: start; }
  .step-body .pill { justify-self: start; align-self: start; }
}

/* About > Education: plain rows with a hairline on top, in the same quiet style as the Future Builds list */
.edu-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.edu-list li { display: flex; flex-direction: column; gap: 4px; padding: 20px 0 8px; border-top: 1px solid var(--line); }
.edu-year { font-size: 14px; font-weight: 500; color: var(--muted); }
.edu-degree { font-family: var(--font-head); font-weight: 500; font-size: var(--fs-h3); line-height: 1.25; letter-spacing: var(--tracking-head); color: var(--text); }
.edu-school { font-size: 15px; line-height: 1.55; color: var(--text2); }
@media (max-width: 700px) { .edu-list { grid-template-columns: 1fr; } }
