/* =========================================================
   karlen aleksanyan — personal site
   single stylesheet. no build step, no dependencies.
   edit tokens in :root to retheme.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* color */
  --paper:        #FAF7F2;
  --paper-2:      #F0EBE2;
  --ink:          #1A1815;
  --ink-2:        #5C5853;
  --ink-3:        #8C8881;
  --rule:         #D6D0C4;
  --rule-2:       #E8E2D6;
  --accent:       #E11D48;
  --accent-hover: #BE123C;
  --accent-soft:  rgba(225, 29, 72, 0.18);

  /* type */
  --font-serif: "EB Garamond", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* layout */
  --maxw:    720px;
  --measure: 64ch;
  --pad:     clamp(20px, 5vw, 32px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 120ms ease, opacity 120ms ease;
}
a:hover { color: var(--accent-hover); }
a:active { opacity: 0.7; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

img { max-width: 100%; height: auto; display: block; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: pretty;
}
h1 { font-size: 36px; letter-spacing: -0.01em; margin: 0 0 12px; }
h2 { font-size: 28px; margin: 48px 0 12px; }
h3 { font-size: 22px; margin: 32px 0 8px; }
h4 { font-size: 18px; font-weight: 500; font-style: italic; margin: 24px 0 8px; }

p {
  margin: 0 0 16px;
  text-wrap: pretty;
  max-width: var(--measure);
}

ul, ol {
  margin: 0 0 16px;
  padding-left: 24px;
  max-width: var(--measure);
}
li { margin-bottom: 6px; }
li::marker { color: var(--ink-3); }

blockquote {
  margin: 24px 0;
  padding: 0 0 0 20px;
  border-left: 1px solid var(--rule);
  color: var(--ink-2);
  font-style: italic;
  max-width: var(--measure);
}

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
code {
  background: var(--paper-2);
  padding: 1px 4px;
  border-radius: 2px;
}
pre {
  background: var(--paper-2);
  padding: 16px;
  border-radius: 2px;
  overflow-x: auto;
  line-height: 1.4;
  margin: 16px 0;
}
pre code { background: transparent; padding: 0; }

table {
  border-collapse: collapse;
  width: 100%;
  max-width: var(--measure);
  margin: 24px 0;
  font-size: 15px;
}
th, td {
  text-align: left;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--rule-2);
  vertical-align: top;
}
th { font-weight: 600; color: var(--ink-2); border-bottom-color: var(--rule); }

figure { margin: 24px 0; max-width: var(--measure); }
figure img { border: 1px solid var(--rule); }
figcaption { margin-top: 8px; font-size: 15px; color: var(--ink-2); }

/* layout ----------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.app { min-height: 100vh; display: flex; flex-direction: column; }
.app__inner { flex: 1 0 auto; padding-top: 56px; padding-bottom: 0; }

main { max-width: var(--measure); }

/* header ----------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 64px;
}
.site-mark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 21px;
  color: var(--ink);
  text-decoration: none;
}
.site-mark:hover { color: var(--ink); }

.site-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.site-nav__link { font-size: 18px; }
.site-nav__link.is-active {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

/* page header ------------------------------------------------------ */

.page-title { font-size: 36px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; }
.lead { font-size: 21px; line-height: 1.55; color: var(--ink); }
.crumb {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  margin: 0 0 16px;
  text-transform: lowercase;
}
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--accent); }

.meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-3);
  margin-bottom: 24px;
}

/* bare list helpers ------------------------------------------------ */

.bare-list { list-style: none; padding: 0; margin: 0 0 24px; max-width: 100%; }
.bare-list li { margin: 0; padding: 0; }

/* projects list ---------------------------------------------------- */

.project-list { margin-top: 24px; }
.project-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-2);
}
.project-row:last-child { border-bottom: 0; }
.project-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.project-row__title { font-weight: 600; font-size: 21px; }
.project-row__year { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.project-row__desc { font-size: 18px; color: var(--ink-2); }

/* experience list -------------------------------------------------- */

.exp-list { margin-top: 24px; }
.exp-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-2);
}
.exp-row:last-child { border-bottom: 0; }
.exp-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.exp-row__role { font-weight: 600; font-size: 21px; }
.exp-row__year { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.exp-row__org { font-size: 18px; color: var(--ink-2); }
.exp-row__desc { font-size: 18px; color: var(--ink-2); }

/* essay rows (home) ----------------------------------------------- */

.essay-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule-2);
}
.essay-row:last-child { border-bottom: 0; }
.essay-row__meta { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }

/* essay list (essays index) --------------------------------------- */

.essays-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.essay-list { margin-top: 24px; }
.essay-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.essay-item:last-child { border-bottom: 0; }
.essay-item__title { font-size: 21px; font-weight: 500; }
.essay-item__meta { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.essay-item__dek { font-size: 18px; color: var(--ink-2); }

/* misc utilities --------------------------------------------------- */

.muted   { color: var(--ink-2); }
.faint   { color: var(--ink-3); }
.italic  { font-style: italic; }
.mono    { font-family: var(--font-mono); }
.small   { font-size: 15px; }

.links-row { margin: 24px 0; font-size: 18px; }
.dot { color: var(--ink-3); }

.back {
  margin-top: 32px;
  font-size: 15px;
  color: var(--ink-2);
  font-style: italic;
}
.back a { font-style: normal; }

.rss {
  text-decoration: none;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 13px;
}
.rss:hover { color: var(--accent); }

/* footer ----------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 48px;
  padding: 24px 0 48px;
  color: var(--ink-2);
  font-size: 15px;
}
.site-footer .dot { color: var(--ink-3); }
.site-footer__row { margin-bottom: 6px; }
.site-footer__meta { color: var(--ink-3); font-style: italic; font-size: 13px; }

/* small screens ---------------------------------------------------- */

@media (max-width: 640px) {
  body { font-size: 17px; }
  .app__inner { padding-top: 32px; }
  .site-header { margin-bottom: 40px; }
  .site-nav { gap: 14px; }
  .page-title { font-size: 28px; }
  .lead { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a { transition: none; }
}
