@charset "UTF-8";
/* =========================================================================
   Reshinth Adithyan — personal site
   Refined minimal: warm paper, near-monochrome ink, one restrained accent.
   Serif (Newsreader) for reading, mono (JetBrains Mono) for labels & code.
   ========================================================================= */

/* ---- Theme tokens -------------------------------------------------------- */
:root,
[data-theme="light"] {
  --bg:          #f3f0e6;  /* warm ivory, à la Anthropic */
  --bg-subtle:   #eae5d6;
  --bg-code:     #ebe5d6;
  --text:        #1a1714;
  --text-muted:  #6c655a;
  --text-faint:  #978f80;
  --border:      #e1dbc9;
  --border-soft: #eae4d5;
  --accent:      #2f6a4d;  /* forest green */
  --accent-deep: #234f39;
  --accent-soft: rgba(47, 106, 77, 0.11);
  --shadow:      0 1px 2px rgba(40, 30, 20, 0.05), 0 10px 26px -18px rgba(40, 30, 20, 0.22);
}

[data-theme="dark"] {
  --bg:          #100f0e;
  --bg-subtle:   #1a1917;
  --bg-code:     #1c1b18;
  --text:        #eae7df;
  --text-muted:  #a09b90;
  --text-faint:  #6c675e;
  --border:      #2a2824;
  --border-soft: #211f1c;
  --accent:      #66b890;
  --accent-deep: #84caa6;
  --accent-soft: rgba(102, 184, 144, 0.13);
  --shadow:      0 1px 2px rgba(0, 0, 0, 0.30), 0 12px 30px -18px rgba(0, 0, 0, 0.65);
}

/* ---- Fonts --------------------------------------------------------------- */
:root {
  --font-serif: "Newsreader", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", "Menlo", "Cascadia Code", monospace;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }

body {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 1.225rem;
  line-height: 1.62;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s ease, color 0.4s ease;
}

::selection { background: var(--accent-soft); color: var(--accent-deep); }

/* ---- Layout -------------------------------------------------------------- */
.wrap {
  max-width: 41rem;
  margin: 0 auto;
  padding: clamp(2.75rem, 6vw, 5.5rem) clamp(1.4rem, 5vw, 2rem) 4rem;
}

section { margin-top: clamp(2.75rem, 5vw, 3.75rem); }

/* ---- Eyebrow section labels ---------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- Typography ---------------------------------------------------------- */
h1, h2, h3 { font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }

p { margin-top: 1rem; }
p:first-child { margin-top: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
a:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent);
}

strong { font-weight: 600; }
em { font-style: italic; }

/* ---- Intro / header ------------------------------------------------------ */
.intro { display: flex; gap: 1.6rem; align-items: center; }
.intro > div { min-width: 0; } /* let the text column shrink + wrap inside flex */

.intro__photo {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.02);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.intro__name {
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}
.intro__role {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.45;
}
.intro__role .sep { color: var(--text-faint); padding: 0 0.15rem; }

/* ---- Social row ---------------------------------------------------------- */
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.95rem;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}
.social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.social svg { width: 1.02rem; height: 1.02rem; display: block; }

/* ---- Prose --------------------------------------------------------------- */
.prose p { color: var(--text); }
.prose a { font-weight: 500; }

/* ---- Research interests -------------------------------------------------- */
.interests { list-style: none; padding: 0; }
.interests li {
  position: relative;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}
.interests li:first-child { margin-top: 0; }
.interests li::before {
  content: "\2192"; /* → */
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ---- Entry list (publications / patents) --------------------------------- */
.entry { padding: 1.15rem 0; border-top: 1px solid var(--border-soft); }
.entry:first-child { border-top: none; padding-top: 0.25rem; }

.entry__title { font-size: 1.16rem; font-weight: 500; line-height: 1.35; }
.entry__title a { color: var(--text); text-decoration: none; }
.entry__title a:hover { color: var(--accent); }

.entry__meta {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 1.0rem;
  line-height: 1.5;
}
.entry__meta .me { color: var(--text); font-weight: 600; font-style: normal; }

.entry__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.55rem; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.12rem 0.5rem;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
a.tag:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tag--year { color: var(--text-faint); background: transparent; border-color: transparent; padding-left: 0; }

/* ---- Experience timeline ------------------------------------------------- */
.timeline { display: grid; gap: 1.6rem; }
.job { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.4rem 1.4rem; }
.job__when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--text-faint);
  padding-top: 0.3rem;
  white-space: nowrap;
}
.job__role { font-weight: 600; }
.job__org { color: var(--text-muted); }
.job__org::before { content: "\00B7\00A0"; color: var(--text-faint); } /* ·&nbsp; */
.job__note { margin-top: 0.25rem; color: var(--text-muted); font-size: 1.0rem; line-height: 1.5; }

/* ---- Writing list -------------------------------------------------------- */
.post-link {
  display: block;
  padding: 1.1rem 1.15rem;
  margin: 0 -1.15rem;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.post-link:hover { background: var(--bg-subtle); }
.post-link__title { font-size: 1.16rem; font-weight: 500; color: var(--text); }
.post-link:hover .post-link__title { color: var(--accent); }
.post-link__date { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-faint); margin-top: 0.15rem; }
.post-link__desc { color: var(--text-muted); font-size: 1.0rem; margin-top: 0.4rem; }

/* ---- Footer -------------------------------------------------------------- */
.foot {
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.foot a { color: var(--text-muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---- Theme toggle -------------------------------------------------------- */
.theme-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-muted);
  cursor: pointer;
  z-index: 20;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(12deg); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

/* ---- Article (blog post) ------------------------------------------------- */
.article-head { margin-bottom: 2.5rem; }
.back-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-faint);
  display: inline-block;
  margin-bottom: 2rem;
}
.back-link:hover { color: var(--accent); }
.article-title { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 500; letter-spacing: -0.015em; }
.article-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-faint); margin-top: 0.9rem; }

.article h2 { font-size: 1.5rem; margin-top: 2.75rem; }
.article h3 { font-size: 1.2rem; margin-top: 2rem; }
.article p { margin-top: 1.15rem; }
.article ul, .article ol { margin-top: 1.1rem; padding-left: 1.3rem; }
.article li { margin-top: 0.3rem; }
.article li::marker { color: var(--text-faint); }

.article figure { margin: 2rem 0; }
.article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fbfaf6;
}
.article figcaption {
  font-size: 0.9rem;
  color: var(--text-faint);
  text-align: center;
  margin-top: 0.7rem;
}
.embed { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); margin: 2rem 0; }
.embed iframe { display: block; width: 100%; border: 0; }

/* ---- Code ---------------------------------------------------------------- */
code, pre, kbd { font-family: var(--font-mono); }
:not(pre) > code {
  font-size: 0.86em;
  background: var(--bg-code);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  padding: 0.1em 0.36em;
}
pre {
  font-size: 0.84rem;
  line-height: 1.6;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin: 1.6rem 0;
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

/* ---- Tables -------------------------------------------------------------- */
.table-scroll { overflow-x: auto; margin: 1.6rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
th, td { text-align: left; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border); }
th {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
td { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 560px) {
  body { font-size: 1.14rem; }
  /* Stack the intro: photo on top, full-width name below — clears the fixed toggle. */
  .intro { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .intro__photo { width: 76px; height: 76px; }
  .job { grid-template-columns: 1fr; gap: 0.15rem; }
  .job__when { padding-top: 0; }
  .theme-toggle { top: 0.9rem; right: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
