/* aravind punnithan — personal site
   monospace, dark by default, light on request */

:root {
  --bg:        #16130f;
  --bg-soft:   #1e1a15;
  --fg:        #e8ddc8;
  --fg-soft:   #b8ad97;
  --fg-faint:  #756d5e;
  --accent:    #d4915a;
  --rule:      #2a241d;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", SFMono-Regular,
          Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 72ch;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-y: clamp(3rem, 7vw, 5rem);
}

:root[data-theme="light"] {
  --bg:        #f4ede0;
  --bg-soft:   #ece3d2;
  --fg:        #1f1b16;
  --fg-soft:   #4a4138;
  --fg-faint:  #80766a;
  --accent:    #8b3a1f;
  --rule:      #d9d0bd;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dashed var(--rule);
  transition: color .15s ease, border-color .15s ease;
}
a:hover, a:focus-visible { color: var(--accent); border-bottom-color: var(--accent); outline: none; }

hr {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 0 auto;
  max-width: var(--measure);
}

/* ── bar ───────────────────────────────────────── */
.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  flex-wrap: wrap;
}

.brand {
  border: none;
  font-weight: 500;
  color: var(--fg);
}
.brand .prompt { color: var(--accent); }
.brand:hover .prompt { color: var(--fg); }

.nav {
  display: flex;
  gap: 1.1rem;
  margin-left: auto;
  flex-wrap: wrap;
  font-size: 13px;
}
.nav a {
  border-bottom: none;
  color: var(--fg-soft);
}
.nav a:hover { color: var(--accent); }

.theme {
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--fg-soft);
  font: inherit;
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 2px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.theme:hover { color: var(--accent); border-color: var(--accent); }

/* ── main ──────────────────────────────────────── */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--section-y) 0;
}

/* ── hero ──────────────────────────────────────── */
.hero { padding: clamp(3rem, 9vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }

.cmd {
  margin: 0 0 1.5rem;
  font-size: 13px;
  color: var(--fg-faint);
}
.cmd .who { color: var(--accent); }
.cmd .sep { color: var(--fg-soft); }
.cmd::after {
  content: "_";
  margin-left: 0.4ch;
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

h1 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
  margin: 0 0 1.5rem;
  line-height: 1.2;
}

.lede {
  font-size: clamp(1rem, 1vw + 0.85rem, 1.15rem);
  color: var(--fg-soft);
  margin: 0 0 1.5rem;
  max-width: 56ch;
  line-height: 1.6;
}

.meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--fg-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
}
.meta .dot { color: var(--rule); }

/* ── headings ──────────────────────────────────── */
h2 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--fg);
  margin: 0 0 1.5rem;
  letter-spacing: 0.01em;
}
h2 .num {
  color: var(--accent);
  margin-right: 0.5rem;
  font-weight: 400;
}

h3 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--fg);
  margin: 0 0 0.75rem;
}

/* ── prose ─────────────────────────────────────── */
section p {
  margin: 0 0 1.2em;
  color: var(--fg-soft);
}
section p:last-child { margin-bottom: 0; }

em {
  font-style: italic;
  color: var(--fg);
}

strong {
  font-weight: 600;
  color: var(--fg);
}

/* ── now / lists ───────────────────────────────── */
.stamp {
  font-size: 12.5px;
  color: var(--fg-faint);
  margin: 0 0 1.2rem;
  letter-spacing: 0.02em;
}

.sub {
  font-size: 12.5px;
  color: var(--accent);
  margin: 1.6rem 0 0.6rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
}
.bullets li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--fg-soft);
}
.bullets li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.aside {
  font-size: 13px;
  color: var(--fg-faint);
  font-style: italic;
  margin-top: 1.4rem;
}

/* ── tools list inside a note ──────────────────── */
.tools {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0;
}
.tools li {
  padding: 0.4rem 0;
  color: var(--fg-soft);
}
.tools .t { color: var(--fg); }
.tools .sepdot { color: var(--fg-faint); margin: 0 0.25rem; }

/* ── notes ─────────────────────────────────────── */
.note {
  padding: 1.2rem 0;
  border-bottom: 1px dashed var(--rule);
}
.note:first-of-type { border-top: 1px dashed var(--rule); margin-top: 1.4rem; }
.note p { margin-bottom: 0; }

/* ── elsewhere ─────────────────────────────────── */
.links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.6rem;
  border-top: 1px dashed var(--rule);
}
.links li { border-bottom: 1px dashed var(--rule); }
.links a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border: none;
  font-size: 14px;
}
.links .k { color: var(--fg); }
.links .v { color: var(--fg-faint); font-style: italic; }
.links a:hover .k, .links a:hover .v { color: var(--accent); }

.hire {
  font-size: 13.5px;
  color: var(--fg-soft);
  padding: 1rem 0 0;
  font-style: italic;
}

/* ── footer ────────────────────────────────────── */
footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px dashed var(--rule);
  font-size: 12.5px;
  color: var(--fg-faint);
}
footer p { margin: 0; max-width: var(--measure); }

/* ── small screens ─────────────────────────────── */
@media (max-width: 620px) {
  .bar { gap: 0.75rem; padding: 1rem var(--gutter); }
  .nav { margin-left: 0; width: 100%; order: 3; }
  .theme { order: 2; margin-left: auto; }
}

/* ── motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cmd::after { animation: none; }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
