/* ----- Tokens (light) ----- */
:root, [data-theme="light"] {
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-cream-strong: #e8e0d2;
  --surface-dark: #181715;
  --surface-dark-elevated: #252320;
  --surface-dark-soft: #1f1e1b;
  --ink: #141413;
  --body-strong: #252523;
  --body: #3d3d3a;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;
  --primary: #cc785c;
  --primary-active: #a9583e;
  --on-primary: #ffffff;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
  --accent-teal: #5db8a6;
  --accent-amber: #e8a55a;
}

/* ----- Tokens (dark) ----- */
[data-theme="dark"] {
  --canvas: #181715;
  --surface-soft: #1f1e1b;
  --surface-card: #252320;
  --surface-cream-strong: #2e2c28;
  --surface-dark: #0f0e0c;
  --surface-dark-elevated: #1f1e1b;
  --surface-dark-soft: #181715;
  --ink: #faf9f5;
  --body-strong: #ebe6df;
  --body: #cfccc4;
  --muted: #a09d96;
  --muted-soft: #8e8b82;
  --hairline: #2e2c28;
  --hairline-soft: #252320;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  background: var(--canvas);
  color: var(--body);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ----- Typography scale ----- */
.display-xl, .display-lg, .display-md, .display-sm {
  font-family: 'EB Garamond', 'Tiempos Headline', Garamond, 'Times New Roman', serif;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.display-xl { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -1.5px; }
.display-lg { font-size: clamp(32px, 4.5vw, 48px); line-height: 1.1; letter-spacing: -1px; }
.display-md { font-size: clamp(28px, 3.5vw, 36px); line-height: 1.15; letter-spacing: -0.5px; }
.display-sm { font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2; letter-spacing: -0.3px; }

.title-lg { font-size: 22px; font-weight: 500; line-height: 1.3; color: var(--ink); margin: 0; }
.title-md { font-size: 18px; font-weight: 500; line-height: 1.4; color: var(--ink); margin: 0; }
.title-sm { font-size: 16px; font-weight: 500; line-height: 1.4; color: var(--ink); margin: 0; }
.body-md { font-size: 16px; line-height: 1.55; color: var(--body); }
.body-sm { font-size: 14px; line-height: 1.55; color: var(--body); }
.caption { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--muted); }
.caption-up {
  font-size: 12px; font-weight: 500; line-height: 1.4; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ----- Layout ----- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 48px; } }

.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--hairline-soft); }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--ink); color: var(--canvas);
  padding: 12px 16px; border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 16px; top: 16px; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 20px;
  font-size: 14px; font-weight: 500; line-height: 1;
  border-radius: 8px; transition: background-color .15s ease;
}
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-active); text-decoration: none; }
.btn--secondary { background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); }
.btn--secondary:hover { background: var(--surface-card); text-decoration: none; }
.btn--on-coral { background: var(--canvas); color: var(--ink); }
.btn--on-coral:hover { background: var(--surface-card); text-decoration: none; }

/* ----- Top nav ----- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topnav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 600; font-size: 16px;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 22px; height: 22px; color: var(--ink); }
.topnav__links { display: none; gap: 28px; }
.topnav__links a {
  color: var(--ink); font-size: 14px; font-weight: 500;
  position: relative;
}
.topnav__links a:hover { color: var(--primary); text-decoration: none; }
.topnav__links a.active { color: var(--primary); }
.topnav__links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px;
  background: var(--primary);
}
.topnav__actions { display: flex; align-items: center; gap: 8px; }
.topnav__cta { display: none; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); border: 1px solid var(--hairline);
}
.theme-toggle:hover { background: var(--surface-card); }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle__moon { display: block; }
.menu-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); border: 1px solid var(--hairline);
}

@media (min-width: 900px) {
  .topnav__links { display: inline-flex; }
  .topnav__cta { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* ----- Badges ----- */
.badge {
  display: inline-block;
  background: var(--surface-card); color: var(--ink);
  font-size: 13px; font-weight: 500; line-height: 1.4;
  padding: 4px 12px; border-radius: 9999px;
}
.badge--coral {
  background: var(--primary); color: var(--on-primary);
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
}

/* ----- Hero ----- */
.hero { padding-top: 64px; }
.hero__grid {
  display: grid; gap: 48px;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 1024px) {
  .hero__grid { grid-template-columns: 1fr 1fr; gap: 64px; }
}
.hero__lede > * + * { margin-top: 24px; }
.hero__sub { color: var(--body); font-size: 18px; max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__mockup .mockup {
  background: var(--surface-dark); color: var(--on-dark);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(20,20,19,.08);
}
.mockup__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  background: var(--surface-dark-elevated);
  border-bottom: 1px solid var(--surface-cream-strong);
}
.mockup__dot { width: 10px; height: 10px; border-radius: 50%; background: #3d3b37; }
.mockup__dot:nth-child(1) { background: #e8a55a; }
.mockup__dot:nth-child(2) { background: #5db872; }
.mockup__dot:nth-child(3) { background: #c64545; }
.mockup__title { margin-left: 12px; font-size: 12px; color: var(--on-dark-soft); }
.mockup__code {
  padding: 24px; margin: 0;
  font-size: 13px; line-height: 1.7;
  color: var(--on-dark);
  white-space: pre; overflow-x: auto;
}
.c-coral { color: var(--primary); }
.c-teal  { color: var(--accent-teal); }
.c-amber { color: var(--accent-amber); }
.c-muted { color: var(--on-dark-soft); }

/* Terminal typewriter cursor */
.mockup__cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--on-dark);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: mockup-blink 1s steps(2, start) infinite;
}
.mockup__code--done .mockup__cursor {
  animation: mockup-blink 1.1s steps(2, start) infinite;
  opacity: 0.7;
}
@keyframes mockup-blink {
  to { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .mockup__cursor { animation: none; opacity: 0.5; }
}

/* ----- Section heading ----- */
.section__head { margin-bottom: 48px; max-width: 60ch; }
.section__head .caption-up { display: inline-block; margin-bottom: 12px; color: var(--primary); }
.section__head h2 { margin-top: 0; }

/* ----- Card grids ----- */
.cards { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 700px)  { .cards--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface-card); color: var(--ink);
  border-radius: 12px; padding: 32px;
}
.card > * + * { margin-top: 16px; }
.card__icon {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--canvas); color: var(--primary);
  border-radius: 8px;
}
.card__icon svg { width: 22px; height: 22px; }

/* ----- Experience timeline ----- */
.section--soft { background: var(--surface-soft); }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline__item {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
  padding: 32px 0;
  border-top: 1px solid var(--hairline);
}
.timeline__item:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 800px) {
  .timeline__item { grid-template-columns: 220px 1fr; gap: 48px; }
}
.timeline__meta { display: flex; flex-direction: column; gap: 4px; }
.timeline__company { color: var(--primary); }
.timeline__body > * + * { margin-top: 12px; }
.bullets { list-style: none; padding: 0; }
.bullets li { position: relative; padding-left: 20px; margin-top: 8px; }
.bullets li::before {
  content: ''; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}

.edu {
  margin-top: 48px; padding: 24px;
  border-left: 3px solid var(--primary);
  background: var(--canvas);
  border-radius: 0 8px 8px 0;
}
.edu .caption-up { display: block; margin-bottom: 8px; color: var(--muted); }

/* ----- Client tiles ----- */
.tiles {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 700px)  { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .tiles { grid-template-columns: repeat(6, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: 12px;
  background: var(--canvas); border: 1px solid var(--hairline);
  color: var(--ink);
  min-height: 128px; justify-content: space-between;
}
.tile .caption-up { color: var(--muted); }
.tile__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 700; font-size: 14px; line-height: 1;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  user-select: none;
}
.tile__logo--stc      { background: #4F2D7F; color: #ffffff; }
.tile__logo--jio      { background: #0F3CC9; color: #ffffff; }
.tile__logo--ntt      { background: #0066B3; color: #ffffff; }
.tile__logo--ammov    { background: #FFCB05; color: #141413; }
.tile__logo--daimler  { background: #1F1F1F; color: #ffffff; }
.tile__logo--gm       { background: #005DAA; color: #ffffff; }
.tile__logo--etisalat { background: #62A744; color: #ffffff; }
.tile__logo--maxis    { background: #0B5BAA; color: #ffffff; }
.tile__logo--eicher   { background: #E2231A; color: #ffffff; }
.tile__logo--volvo    { background: #1A57A5; color: #ffffff; }
.tile__logo--google {
  background: #ffffff;
  border: 1px solid var(--hairline);
  background-image: linear-gradient(135deg,
    #4285F4 0 25%, #EA4335 25% 50%, #FBBC05 50% 75%, #34A853 75% 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-size: 22px;
}

/* ----- Skills ----- */
.skills { display: grid; gap: 28px; }
.skills__group { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 800px) {
  .skills__group { grid-template-columns: 200px 1fr; align-items: baseline; gap: 32px; }
}
.skills dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-block;
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--hairline);
  padding: 6px 12px; border-radius: 9999px;
  font-size: 13px; font-weight: 500;
}

/* ----- Contact callout ----- */
.callout {
  background: var(--primary); color: var(--on-primary);
  border-radius: 16px; padding: 56px 32px;
  text-align: left;
}
@media (min-width: 800px) { .callout { padding: 72px 64px; } }
.callout > * + * { margin-top: 24px; }
.callout__title { color: var(--on-primary); margin-top: 16px; }
.callout__sub { color: var(--on-primary); opacity: .92; max-width: 56ch; }
.callout__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.callout .badge--coral { background: rgba(255,255,255,.18); color: var(--on-primary); }

/* ----- Footer ----- */
.footer { background: var(--surface-dark); color: var(--on-dark-soft); padding: 64px 0 32px; margin-top: 96px; }
.brand--on-dark, .brand--on-dark .brand__mark { color: var(--on-dark); }
.footer__grid {
  display: grid; gap: 32px;
  grid-template-columns: 1fr;
}
@media (min-width: 800px)  { .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer__brand .body-sm { color: var(--on-dark-soft); margin-top: 12px; max-width: 36ch; }
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__col .caption-up { color: var(--on-dark); margin-bottom: 4px; }
.footer__col a { color: var(--on-dark-soft); font-size: 14px; }
.footer__col a:hover { color: var(--on-dark); text-decoration: underline; }
.footer__bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid var(--surface-cream-strong);
}
.footer__bottom .body-sm { color: var(--on-dark-soft); }

/* ----- Mobile menu ----- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 100;
  background: var(--canvas);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__panel {
  height: 100%; display: flex; flex-direction: column;
  padding: 24px 24px 32px; gap: 24px;
}
.mobile-menu__close {
  align-self: flex-end;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--ink); border: 1px solid var(--hairline);
  display: inline-flex; align-items: center; justify-content: center;
}
.mobile-menu nav {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px;
}
.mobile-menu nav a {
  font-family: 'EB Garamond', serif;
  font-size: 28px; color: var(--ink);
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline-soft);
}
.mobile-menu nav a:hover { text-decoration: none; color: var(--primary); }
.mobile-menu__cta { align-self: flex-start; }
body.menu-open { overflow: hidden; }

/* ----- Reveal animation ----- */
.reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.btn svg { margin-right: 8px; }

/* ----- Resource cards (Resources page) ----- */
.resource-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .resource-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}

.resource {
  background: var(--surface-card);
  color: var(--ink);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
@media (min-width: 800px) { .resource { padding: 32px; gap: 20px; } }

.resource__head { display: flex; flex-direction: column; gap: 12px; }
.resource__type { align-self: flex-start; }
.resource__title { margin: 0; color: var(--ink); }
.resource__desc { color: var(--body); margin: 0; max-width: 56ch; }

.resource__meta {
  display: flex; flex-wrap: wrap; gap: 20px 28px;
  margin: 0; padding: 16px 0 0;
  border-top: 1px solid var(--hairline);
}
.resource__meta > div { display: flex; flex-direction: column; gap: 4px; }
.resource__meta dt { color: var(--muted); margin: 0; }
.resource__meta dd { color: var(--ink); margin: 0; font-weight: 500; }

.resource__cta {
  align-self: stretch;
  margin-top: 4px;
  gap: 8px;
}
@media (min-width: 800px) { .resource__cta { align-self: flex-start; } }
.resource__cta svg { width: 16px; height: 16px; }

/* ----- Visually-hidden utility ----- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Resource search ----- */
.resource-search {
  position: relative;
  display: flex; align-items: center;
  max-width: 480px;
  margin: 0 0 12px;
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: 9999px;
  padding: 4px 12px 4px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.resource-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.resource-search__icon {
  width: 18px; height: 18px;
  color: var(--muted);
  flex-shrink: 0;
}
.resource-search input {
  flex: 1;
  border: 0; outline: 0; background: transparent;
  font: inherit; color: var(--ink);
  padding: 10px 8px;
  min-width: 0;
}
.resource-search input::placeholder { color: var(--muted); }
.resource-search input::-webkit-search-cancel-button { display: none; }
.resource-search__clear {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--muted);
}
.resource-search__clear:hover { background: var(--canvas); color: var(--ink); }

.resource-search__count {
  margin: 0 0 20px;
  color: var(--muted);
}
.resource-empty {
  padding: 32px;
  text-align: center;
  background: var(--surface-card);
  border-radius: 12px;
  color: var(--muted);
}

/* ----- Gallery grid ----- */
.gallery-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 480px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
}

.gallery__item {
  margin: 0;
  display: flex; flex-direction: column;
  gap: 12px;
}
.gallery__link {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-card);
  cursor: zoom-in;
  border: 0;
  padding: 0;
  width: 100%;
}
.gallery__video-trigger { cursor: pointer; }
.gallery__thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.gallery__link:hover .gallery__thumb { transform: scale(1.03); }
.gallery__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.gallery__play svg {
  width: 64px; height: 64px;
  border-radius: 50%;
  padding: 14px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.gallery__caption {
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

/* ----- Lightbox ----- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 14, 12, .92);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .2s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .lightbox { transition: none; }
}
.lightbox__inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.lightbox__content {
  max-width: 92vw;
  max-height: 80vh;
}
.lightbox__content img,
.lightbox__content iframe {
  display: block;
  max-width: 92vw;
  max-height: 80vh;
  border-radius: 12px;
  background: #000;
}
.lightbox__content iframe {
  width: min(92vw, 1280px);
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
}
.lightbox__caption {
  color: var(--on-dark);
  font-size: 14px;
  text-align: center;
  max-width: 80ch;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: var(--on-dark);
  display: inline-flex; align-items: center; justify-content: center;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255,255,255,.22); }
.lightbox__close { top: -56px; right: 0; }
.lightbox__nav--prev { left: -56px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: -56px; top: 50%; transform: translateY(-50%); }
@media (max-width: 700px) {
  .lightbox__close { top: 4px; right: 4px; }
  .lightbox__nav--prev { left: 4px; top: auto; bottom: 4px; transform: none; }
  .lightbox__nav--next { right: 4px; top: auto; bottom: 4px; transform: none; }
}
body.lightbox-open { overflow: hidden; }
