/* ranjithj.in — Option B "Modern minimal"
   Shared stylesheet: tokens + base + header + footer + components.
   Theme is driven by data-theme on <html> ("light" | "dark").
   With no data-theme set, the OS preference decides. */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&family=Noto+Sans+Malayalam:wght@400;500&display=swap");

/* ── Tokens ──────────────────────────────────────────────────────────── */

:root,
:root[data-theme="light"] {
  --bg: #FAFAF9;          /* page background */
  --fg: #0A0A0B;          /* primary text, primary button fill */
  --muted: #5C5F66;       /* body copy, secondary text */
  --subtle: #6E7178;      /* meta text, mono labels, footer */
  --faint: #85858C;       /* large display text only */
  --border: #E7E7E5;      /* card borders, list rules, image borders */
  --line: #ECECEA;        /* header / footer hairlines */
  --btnline: #DCDCD9;     /* outline-button and input borders */
  --surface: #FFFFFF;     /* cards, inputs, secondary buttons */
  --soft: #F2F2F0;        /* row hover, icon tiles */
  --soft2: #F0F0EE;       /* tinted panels */
  --hover: #F7F7F5;       /* table row hover */
  --strong: #BDBDB9;      /* card hover border, dashed outlines, rules */
  --rule: #D6D6D3;        /* dividers inside tinted panels */
  --muted2: #4F525A;      /* body copy on tinted panels */
  --glass: rgba(250, 250, 249, 0.85);
  --teal: #007A72;        /* tool accent */
  --sel: #F2F8F7;         /* selected option background */
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0B0B0C;
  --fg: #EDEDEC;
  --muted: #A1A4AB;
  --subtle: #8B8E95;
  --faint: #6E7076;
  --border: #232326;
  --line: #1E1E21;
  --btnline: #2E2E32;
  --surface: #141416;
  --soft: #1C1C1F;
  --soft2: #161618;
  --hover: #1A1A1D;
  --strong: #4A4A50;
  --rule: #2E2E32;
  --muted2: #B3B6BC;
  --glass: rgba(11, 11, 12, 0.8);
  --teal: #2CC4B6;
  --sel: #0F2523;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0B0B0C; --fg: #EDEDEC; --muted: #A1A4AB; --subtle: #8B8E95; --faint: #6E7076;
    --border: #232326; --line: #1E1E21; --btnline: #2E2E32; --surface: #141416; --soft: #1C1C1F;
    --soft2: #161618; --hover: #1A1A1D; --strong: #4A4A50; --rule: #2E2E32; --muted2: #B3B6BC;
    --glass: rgba(11, 11, 12, 0.8); --teal: #2CC4B6; --sel: #0F2523;
    color-scheme: dark;
  }
}

:root {
  /* Type */
  --font-sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-ml: "Noto Sans Malayalam", "Geist", system-ui, sans-serif;

  /* Layout */
  --container: 1080px;
  --container-narrow: 760px;
  --container-tool: 720px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-gap: 112px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 999px;

  /* Per-app accents (icons and small dots only; never body text) */
  --accent-site: #007A72;
  --accent-yaja: #4A7041;
  --accent-yata: #8E4A3B;
  --accent-vayana: #006A60;
  --accent-assetrack: #5A5FD4;

  --accent: var(--accent-site);
}

/* ── Base ────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s, color .25s;
  overflow-wrap: break-word;
}

a { color: var(--fg); text-decoration: none; }

img, svg { max-width: 100%; }

h1, h2, h3, h4 { letter-spacing: -0.02em; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: 0; left: var(--gutter); transform: translateY(-120%);
  z-index: 40; padding: 10px 16px; background: var(--fg); color: var(--bg);
  border-radius: 0 0 var(--r-sm) var(--r-sm); font-size: 14px; font-weight: 500;
}
.skip-link:focus { transform: translateY(0); }

.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.container-tool { max-width: var(--container-tool); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

.mono { font-family: var(--font-mono); }
.ml { font-family: var(--font-ml); }

.section { padding-bottom: var(--section-gap); }

/* Section header row: label left, mono count or link right */
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; padding-bottom: 20px;
}
.section-head h2 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0; }
.section-count { font-family: var(--font-mono); font-size: 12px; color: var(--subtle); }
.section-link {
  font-size: 14px; color: var(--muted); display: inline-flex; align-items: center;
  gap: 6px; min-height: 32px;
}
.section-link:hover { color: var(--fg); }

.h2-large {
  margin: 0; font-weight: 600; font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.12; letter-spacing: -0.035em;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  max-width: var(--container); margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 24px;
}

.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.logo { width: 28px; height: 28px; display: block; }

.nav-right { display: flex; align-items: center; gap: 4px 20px; }

.nav-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; font-size: 14px;
}
.nav-link { color: var(--muted); }
.nav-link:hover { color: var(--fg); }
.nav-link[aria-current="page"] { color: var(--fg); font-weight: 500; }

.nav-contact {
  min-height: 36px; padding: 0 14px; display: inline-flex; align-items: center;
  border: 1px solid var(--btnline); border-radius: var(--r-pill);
  background: var(--surface); font-weight: 500; font-size: 14px;
  transition: border-color .2s;
}
.nav-contact:hover { border-color: var(--strong); }

.theme-toggle,
.nav-menu-btn {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0;
  border-radius: var(--r-pill);
}
.theme-toggle:hover,
.nav-menu-btn:hover { color: var(--fg); }

/* Icon and logo swap by theme */
.icon-sun, .logo-dark { display: none; }
.logo-light { display: block; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
:root[data-theme="dark"] .logo-light { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .icon-sun { display: block; }
  :root:not([data-theme]) .icon-moon { display: none; }
  :root:not([data-theme]) .logo-dark { display: block; }
  :root:not([data-theme]) .logo-light { display: none; }
}

.nav-menu-btn { display: none; }
.nav-menu-btn .icon-close { display: none; }
.nav-menu-btn[aria-expanded="true"] .icon-close { display: block; }
.nav-menu-btn[aria-expanded="true"] .icon-bars { display: none; }

@media (max-width: 640px) {
  .nav-menu-btn { display: flex; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 4px var(--gutter) 12px; display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links .nav-link {
    display: flex; align-items: center; min-height: 48px;
    border-bottom: 1px solid var(--line); font-size: 16px;
  }
  .nav-links li:last-child .nav-link { border-bottom: 0; }
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--line); }
.site-footer > div {
  max-width: var(--container); margin: 0 auto;
  padding: 24px var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 12px; font-size: 13px; color: var(--subtle);
}
.site-footer a { color: var(--subtle); text-decoration: underline; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--fg); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }

/* ── Buttons and chips ───────────────────────────────────────────────── */

.btn {
  min-height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  font-family: var(--font-sans); font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer; text-align: center;
  transition: border-color .2s, opacity .2s;
}
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { opacity: .88; }
.btn-outline { background: var(--surface); border-color: var(--btnline); color: var(--fg); }
.btn-outline:hover { border-color: var(--strong); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); }
.btn-dashed {
  background: transparent; border: 1px dashed var(--strong); color: var(--subtle);
  cursor: default;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row-center { justify-content: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--surface); font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.chip-dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--accent); flex: none; }
.chip-outline { background: transparent; border-color: var(--strong); letter-spacing: 0.14em; }

/* ── Cards, lists, feature grid ──────────────────────────────────────── */

.grid-auto {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.lift { transition: border-color .2s, transform .2s; }
.lift:hover { border-color: var(--strong); transform: translateY(-2px); }

.card-icon {
  width: 44px; height: 44px; border-radius: var(--r-md); background: var(--soft);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.card-icon svg, .card-icon img { width: 28px; height: 28px; display: block; }

.project-card { min-height: 240px; gap: 20px; }
.project-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.project-card h3 { margin: 0; font-size: 20px; font-weight: 600; }
.project-card p { margin: 0; font-size: 15px; color: var(--muted); }
.project-card-body { display: flex; flex-direction: column; gap: 4px; }
.project-card-meta {
  margin-top: auto; display: flex; flex-wrap: wrap; gap: 16px;
  font-family: var(--font-mono); font-size: 12px; color: var(--subtle);
}
.stars { display: inline-flex; align-items: center; gap: 4px; }
.arrow-out { stroke: var(--subtle); flex: none; }

.tool-card h3 { margin: 8px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tool-card p { margin: 0; font-size: 15px; color: var(--muted); }
.tool-card > svg { stroke: var(--accent); }

.list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--border); }
.list-flush { margin-top: 0; }
.list > li { border-bottom: 1px solid var(--border); }
.list-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px;
  padding: 18px 12px; border-radius: var(--r-sm);
  transition: background-color .2s;
}
.list-row:hover { background: var(--soft); }
.list-name { flex: 0 0 160px; font-weight: 500; font-size: 15px; }
.list-desc { flex: 1 1 280px; font-size: 15px; color: var(--muted); }
.list-meta { font-family: var(--font-mono); font-size: 12px; color: var(--subtle); }
.list-row-split { justify-content: space-between; align-items: baseline; }
.list-row-split .list-title { font-weight: 500; font-size: 15px; }

/* Hairline feature grid: 1px gap over a --border background */
.feature-grid {
  display: grid; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.feature { background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.feature h3 { margin: 0; font-size: 15px; font-weight: 600; }
.feature p { margin: 0; font-size: 14px; color: var(--muted); }

/* ── Skeletons ───────────────────────────────────────────────────────── */

.skeleton { background: var(--soft); border-radius: 4px; height: 12px; display: block; }
.skeleton-row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px 12px; }

/* ── App / tool page hero ────────────────────────────────────────────── */

.page-hero {
  max-width: var(--container-narrow); margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) var(--gutter) clamp(48px, 6vw, 72px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
}
.app-icon { width: 72px; height: 72px; display: block; }
.app-icon-tile {
  width: 72px; height: 72px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.app-icon-tile svg { width: 48px; height: 48px; }
.hero-meta {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--subtle); margin: 0;
}
.page-hero h1 {
  margin: 0; font-weight: 600; font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02; letter-spacing: -0.045em;
}
.h1-second { display: block; color: var(--faint); }
.lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--muted); text-wrap: balance; }
.hero-note { margin: 0; font-size: 13px; color: var(--subtle); }

.back-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 14px; color: var(--muted);
}
.back-link:hover { color: var(--fg); }

/* Screenshot row */
.shots {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}
.shots img {
  width: 100%; height: auto; display: block;
  border-radius: var(--r-xl); border: 1px solid var(--border);
}
@media (min-width: 700px) {
  .shots .shot-offset { margin-top: 40px; }
}

/* Two-up cards */
.pair { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.pair .card { padding: clamp(24px, 4vw, 40px); gap: 12px; }
.pair h3 { margin: 0; font-weight: 600; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -0.03em; }
.pair p { margin: 0; color: var(--muted); }

/* Centred quote */
.quote {
  max-width: var(--container-narrow); margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) var(--gutter) var(--section-gap);
  text-align: center;
}
.quote p {
  margin: 0; font-weight: 500; font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35; letter-spacing: -0.03em;
}
.quote .quote-tail { color: var(--subtle); }

/* Tinted panel (vayana E-Ink) */
.panel {
  background: var(--soft2); border: 1px solid var(--border);
  border-radius: var(--r-2xl); padding: clamp(28px, 5vw, 56px);
  display: flex; flex-direction: column; gap: 20px; align-items: flex-start;
}
.panel p { color: var(--muted2); margin: 0; }
.panel-grid {
  display: grid; gap: 24px 32px; margin-top: 8px; width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}
.panel-item { border-top: 1px solid var(--rule); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.panel-item h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-item p { margin: 0; font-size: 14px; }

/* ── Reading column (policy pages) ───────────────────────────────────── */

.prose { font-size: 16px; line-height: 1.7; color: var(--muted); }
.prose h2 { margin: 40px 0 12px; font-size: 20px; font-weight: 600; color: var(--fg); letter-spacing: -0.01em; }
.prose h3 { margin: 28px 0 8px; font-size: 16px; font-weight: 600; color: var(--fg); }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--fg); font-weight: 600; }

/* ── Home hero ───────────────────────────────────────────────────────── */

.home-hero {
  max-width: var(--container); margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) var(--gutter) clamp(80px, 10vw, 128px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.home-hero-logo { width: clamp(150px, 20vw, 240px); margin-bottom: clamp(36px, 5vw, 56px); }
/* No display here: the theme swap below owns it. */
.home-hero-logo img { width: 100%; height: auto; }
.home-hero h1 {
  margin: 0; font-weight: 600; font-size: clamp(44px, 7.5vw, 96px);
  line-height: 1; letter-spacing: -0.05em;
}
.home-hero .btn-row { margin-top: 36px; }

.tagline {
  margin-top: 22px; display: flex; align-items: center; gap: 16px;
  font-family: var(--font-mono); font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--subtle);
}
.tagline-rule { width: 32px; height: 1px; background: var(--strong); flex: none; }

.roles {
  margin: 36px 0 0; max-width: 560px;
  font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6;
  color: var(--muted); text-wrap: balance;
}
.roles a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.roles a:hover { color: var(--fg); }

/* ── Contact card ────────────────────────────────────────────────────── */

.contact-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-2xl); padding: clamp(32px, 6vw, 64px);
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: flex-end; gap: 32px;
}
.contact-copy { display: flex; flex-direction: column; gap: 12px; flex: 1 1 360px; }
.contact-copy h2 {
  margin: 0; font-weight: 600; font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05; letter-spacing: -0.04em;
}
.contact-copy p { margin: 0; color: var(--muted); }
.contact-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-pills .btn { padding: 0 16px; }

/* ── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  .lift { transition: none; }
  .lift:hover { transform: none; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
