/* =============================================================================
   site.css — the "sasidharan gs" site, composed on the minimal_text language.
   minimal_text.css supplies the tokens, base reset, font, and components; this
   file is only the site-specific layout + compositions. Load AFTER minimal_text.css.
   Two colors + one functional accent. Inter 300/400. Square. Hairlines. Whitespace.
   ============================================================================= */

/* ---- Layout ---------------------------------------------------------------- */
body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  height: 100vh;
  padding: var(--space-lg) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  z-index: 100;
}

.main {
  grid-column: 2;
  padding: var(--space-lg) var(--space-lg) 0;
}

/* ---- Sidebar: identity ----------------------------------------------------- */
.sidebar__identity { display: flex; flex-direction: column; gap: 0.3em; }

.sidebar__name {
  font-size: var(--text-2xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-name);
  line-height: var(--leading-tight);
  color: var(--fg);
}

.sidebar__role {
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-wider);
  line-height: 1.4;
  color: var(--muted);
}

/* ---- Sidebar: nav (active = accent + a 2px bar in the gutter) -------------- */
.sidebar nav { display: flex; flex-direction: column; gap: var(--space-sm); }

.sidebar nav a {
  position: relative;
  font-size: var(--text-xs);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-nav);
  color: var(--muted);
  transition: var(--transition);
}
.sidebar nav a:hover { color: var(--fg); }
.sidebar nav a.active {
  color: var(--accent);
  font-weight: var(--weight-regular);
}
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-xs) - 4px);
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0.9em;
  background: var(--accent);
}

.sidebar nav .nav-sep {
  height: 1px;
  background: var(--rule);
  margin: calc(var(--space-sm) / 2) 0;
}

/* ---- Sidebar: theme — a 3-way segmented control (mt-segmented), full width -- */
.theme-toggle {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.theme-toggle button {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-nav);
  color: var(--muted);
  transition: var(--transition);
}
.theme-toggle button:hover { color: var(--fg); }
.theme-toggle button.active { color: var(--accent); }

/* ---- Hero ------------------------------------------------------------------ */
#hero { padding: var(--space-xl) 0; }
.hero__text { display: block; line-height: 1; font-weight: inherit; }

/* ---- Sections -------------------------------------------------------------- */
section { padding: var(--space-xl) 0; }
/* accent on the lines that divide the major sections (the "important things") */
section + section { border-top: var(--border-width) solid var(--accent); }

.section__label {
  display: block;
  font-size: var(--text-2xs);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-label);
  color: var(--muted);
  margin-bottom: var(--space-lg);
}

/* ---- About ----------------------------------------------------------------- */
.about__bio {
  max-width: var(--measure);
  font-size: var(--text-xl);
  font-weight: var(--weight-light);
  line-height: var(--leading-relaxed);
  color: var(--fg);
}

/* ---- Projects -------------------------------------------------------------- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
}

.project-card {
  padding: var(--space-md) 0;
  border-top: var(--border-width) solid var(--rule);
}

.project-card__name {
  margin-bottom: var(--space-xs);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-snug);
}

.project-card__desc {
  margin-bottom: var(--space-sm);
  font-size: var(--text-base);
  font-weight: var(--weight-light);
  line-height: var(--leading-normal);
  color: var(--muted);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}
/* tags read in the foreground colour, not faded grey */
.project-card__tags .mt-pill { color: var(--fg); }

.project-card__links {
  display: flex;
  gap: var(--space-md);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  color: var(--muted);
}
.project-card__links a:hover { color: var(--fg); }

/* ---- Experience ------------------------------------------------------------ */
.experience__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: var(--measure);
}

.exp-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-sm);
  align-items: start;
  padding-bottom: var(--space-md);
  border-bottom: var(--border-width) solid var(--rule);
}

.exp-item__role { font-size: var(--text-md); font-weight: var(--weight-regular); }
.exp-item__company {
  margin-top: 2px;
  font-size: var(--text-base);
  font-weight: var(--weight-light);
  color: var(--muted);
}
.exp-item__dates {
  font-size: var(--text-2xs);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
  white-space: nowrap;
}
.exp-item__highlights {
  margin-top: var(--space-sm);
  padding-left: 1.1em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.exp-item__highlights li {
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  line-height: var(--leading-snug);
  color: var(--muted);
}

/* ---- Contact --------------------------------------------------------------- */
.contact__links { display: flex; flex-direction: column; gap: var(--space-sm); }
.contact__link {
  font-size: var(--text-base);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
  transition: var(--transition);
}
.contact__link:hover { color: var(--fg); }

/* ---- Blog: daily (left) / weekly (right) layout ---------------------------- */
.blog__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  gap: var(--space-lg);
  align-items: start;
}
.blog__daily { min-width: 0; }
/* the partition — an accent hairline dividing the daily notes from the weekly post */
.blog__weekly {
  border-left: var(--border-width) solid var(--accent);
  padding-left: var(--space-lg);
}
.blog__weekly-note {
  max-width: 30ch;
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  line-height: var(--leading-normal);
  color: var(--muted);
}
@media (max-width: 1024px) {
  .blog__layout { grid-template-columns: 1fr; }
  .blog__weekly {
    border-left: 0;
    border-top: var(--border-width) solid var(--accent);
    padding-left: 0;
    padding-top: var(--space-lg);
  }
}

/* ---- Blog: list ------------------------------------------------------------ */
.blog__list { display: flex; flex-direction: column; max-width: var(--measure); }

.blog-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: var(--border-width) solid var(--rule);
}
.blog-entry__title {
  font-size: var(--text-md);
  font-weight: var(--weight-light);
  color: var(--fg);
  transition: var(--transition);
}
.blog-entry:hover .blog-entry__title { color: var(--muted); }
.blog-entry__date {
  font-size: var(--text-2xs);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
  white-space: nowrap;
}
.blog-entry__excerpt {
  grid-column: 1 / -1;
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: var(--weight-light);
  line-height: var(--leading-normal);
  color: var(--muted);
}

/* ---- Blog: a post ---------------------------------------------------------- */
.post__header {
  max-width: 46rem;
  padding: 0 0 var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: var(--border-width) solid var(--rule);
}
.post__title {
  margin-bottom: var(--space-sm);
  font-size: var(--text-2xl);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: var(--accent);
}
.post__date {
  font-size: var(--text-2xs);
  font-weight: var(--weight-light);
  letter-spacing: var(--tracking-wider);
  color: var(--muted);
}

.post__body {
  max-width: 46rem;
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  line-height: var(--leading-loose);
  color: var(--fg);
}
.post__body p { margin: 0 0 var(--space-md); }
.post__body h2,
.post__body h3 {
  margin: var(--space-md) 0 var(--space-sm);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-name);
}
.post__body h2 { font-size: var(--text-xl); }
.post__body h3 { font-size: var(--text-lg); }
.post__body strong { font-weight: var(--weight-regular); }
.post__body ul,
.post__body ol { margin: 0 0 var(--space-md); padding-left: 1.25rem; }
.post__body li { margin-bottom: var(--space-xs); }
.post__body a {
  color: var(--fg);
  border-bottom: var(--border-width) solid var(--rule);
  transition: border-color 0.2s ease;
}
.post__body a:hover { border-color: var(--fg); }
.post__body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--rule);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-pill);
}
.post__body pre {
  margin-bottom: var(--space-md);
  padding: var(--space-sm);
  background: var(--rule);
  border-radius: var(--radius-pill);
  overflow-x: auto;
}
.post__body pre code { padding: 0; background: none; }

.post__back {
  display: inline-block;
  margin-bottom: var(--space-md);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-nav);
  color: var(--muted);
  transition: var(--transition);
}
.post__back:hover { color: var(--fg); }

/* ---- Mobile (top bar) — ≤640 per minimal_text §9a (content-website pattern).
   The desktop sidebar collapses into a single sticky top-bar row: wordmark → home
   on the left, the section links + theme on the right. No bottom bar (that's the
   app pattern). Thin-line stroke icons only. -------------------------------- */
.mobile-nav { display: none; }

@media (max-width: 640px) {
  body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { grid-column: 1; padding: var(--space-md) var(--space-sm) 0; }
  #hero { padding: var(--space-lg) 0; }

  .mobile-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 10px var(--space-sm);
    background: var(--bg);
    border-bottom: var(--border-width) solid var(--rule);
  }

  .mobile-nav__name {
    font-size: var(--text-md);
    font-weight: var(--weight-light);
    letter-spacing: var(--tracking-name);
    color: var(--fg);
    white-space: nowrap;
  }

  .mobile-nav__group { display: flex; align-items: center; gap: 10px; }

  .mobile-nav__blog-link {
    font-size: var(--text-2xs);
    font-weight: var(--weight-light);
    letter-spacing: var(--tracking-wider);
    color: var(--muted);
    white-space: nowrap;
    transition: var(--transition);
  }

  .mobile-nav a,
  .mobile-nav button {
    display: flex;
    align-items: center;
    color: var(--muted);
    transition: var(--transition);
  }
  .mobile-nav a:hover,
  .mobile-nav button:hover { color: var(--fg); }

  /* active = the one functional accent (current section / selected theme) */
  .mobile-nav a.active,
  .mobile-nav button.active { color: var(--accent); }

  .mobile-nav svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}
