/* Nimit Jethwa: minimal personal site */

:root {
  --bg: #faf6f0;
  --text: #2b2420;
  --muted: #857a72;
  --line: #e8e0d6;
  --accent: #b8582f;
  --card: #f4ede3;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --bg: #1c1917;
  --text: #ede6de;
  --muted: #9a8f86;
  --line: #342e2a;
  --accent: #e08a62;
  --card: #25201d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1917;
    --text: #ede6de;
    --muted: #9a8f86;
    --line: #342e2a;
    --accent: #e08a62;
  --card: #25201d;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}

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

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 14vh 24px 64px;
}

section { margin-bottom: 48px; }

p { margin: 0; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s ease;
}
a:hover { text-decoration-color: var(--accent); }

/* Intro */
.intro { margin-bottom: 48px; }

.intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 0;
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 2px;
}

.id { display: flex; align-items: center; gap: 16px; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: .02em;
}

section p + p { margin-top: 1em; }

.lead {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.4;
  margin-bottom: 1.1em;
}
.lead em { color: var(--accent); }

h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  margin: 0 0 2px;
}

/* Now */
.now {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
}
.now-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.updated { font-size: .8rem; color: var(--muted); }
.bullets { margin: 0; padding: 0; list-style: none; }
.bullets li { position: relative; padding-left: 20px; margin: 6px 0; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 2px; top: .7em;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* Principles */
.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: p;
  display: grid;
  gap: 18px;
}
.principles li {
  counter-increment: p;
  display: grid;
  grid-template-columns: 36px 1fr;
}
.principles li::before {
  content: "0" counter(p);
  font-family: var(--serif);
  color: var(--accent);
  padding-top: 2px;
}
.principles h3, .principles p { grid-column: 2; }
.principles p { color: var(--muted); }

/* Tags */
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: .88rem;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  transition: border-color .2s ease, color .2s ease;
}
.tags li:hover { border-color: var(--accent); color: var(--text); }

/* Quote */
.quote {
  margin: 56px 0 0;
  padding-left: 20px;
  border-left: 2px solid var(--accent);
}
.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.4;
}
.quote figcaption { margin-top: 6px; font-size: .85rem; color: var(--muted); }

h2 {
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}

/* Theme toggle: a single dot */
.theme-toggle {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  cursor: pointer;
  flex: none;
  transition: background-color .3s ease, transform .2s ease;
}
.theme-toggle:hover { transform: scale(1.25); }
:root[data-theme="dark"] .theme-toggle { background: transparent; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle { background: transparent; }
}
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* List */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.list li:last-child { border-bottom: 1px solid var(--line); }
.item { font-weight: 500; }
.desc { color: var(--muted); }

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: .85rem;
  color: var(--muted);
  padding-top: 24px;
  margin-top: 72px;
}
#clock { font-variant-numeric: tabular-nums; }

/* Gentle fade-in */
.js .fade {
  opacity: 0;
  transform: translateY(6px);
  animation: fade .6s ease forwards;
}
@keyframes fade { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .js .fade { opacity: 1; transform: none; animation: none; }
}

@media (max-width: 520px) {
  .page { padding-top: 10vh; }
  .avatar { width: 48px; height: 48px; font-size: 1.1rem; }
  .lead { font-size: 1.3rem; }
  .now { padding: 18px; }
  .list li { grid-template-columns: 1fr; gap: 0; }
  .footer { flex-direction: column; gap: 4px; }
}
