/* ---------------------------------------------------------------
   Darius Fahimifar — dariusf.com
   Palette: warm paper / near-black ink / teal-slate + bronze accent
   Type: Fraunces (display) + Inter (body) + IBM Plex Mono (meta/ref)
--------------------------------------------------------------- */

:root {
  --paper: #F6F4EF;
  --paper-raised: #EFEBE1;
  --ink: #16181C;
  --ink-soft: #4B4F57;
  --teal: #2C4A52;
  --teal-soft: #3E6771;
  --bronze: #96723D;
  --line: rgba(22, 24, 28, 0.12);
  --line-strong: rgba(22, 24, 28, 0.22);

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 40rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161A;
    --paper-raised: #1B1E23;
    --ink: #EDEAE2;
    --ink-soft: #A9ACB3;
    --teal: #7FA8B0;
    --teal-soft: #6C929A;
    --bronze: #C79A5C;
    --line: rgba(237, 234, 226, 0.14);
    --line-strong: rgba(237, 234, 226, 0.26);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  a, .status-pill {
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .hero__canvas {
    display: none;
  }
}

/* Layout shell */

.site {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 2.25rem 0 1.75rem;
  border-bottom: 1px solid var(--line);
}

.site-header__mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header__nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-header__nav a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.site-header__nav a:hover {
  color: var(--teal-soft);
  border-bottom-color: currentColor;
}

.site-main {
  flex: 1;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.site-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.site-footer a:hover {
  color: var(--teal-soft);
}

.site-footer__sep {
  opacity: 0.5;
}

/* Hero (intro + ambient canvas) */

.hero {
  position: relative;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero .intro {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

/* Home intro */

.intro {
  max-width: 38rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.intro__line {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.25;
  margin: 0 0 1.1rem;
  letter-spacing: -0.01em;
}

.intro__sub {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0;
  max-width: 34rem;
}

/* 50/50 split */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
}

@media (max-width: 42rem) {
  .split {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  /* Leave the hero canvas some breathing room below the wrapped
     headline/subhead — on narrow viewports the text otherwise fills
     the hero box edge to edge, leaving nowhere for squares to spawn. */
  .hero {
    padding-bottom: 6rem;
  }
}

.split__col {
  min-width: 0;
}

.split__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.6rem;
  margin-bottom: 1.4rem;
}

.split__head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0;
}

.split__all {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-decoration: none;
  color: var(--teal-soft);
  white-space: nowrap;
}

.split__all:hover {
  color: var(--bronze);
}

/* Entry list (posts / projects) */

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entry {
  border-bottom: 1px solid var(--line);
}

.entry:first-child {
  border-top: 1px solid var(--line);
}

.entry__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 0.85rem;
  row-gap: 0.35rem;
  align-items: baseline;
  text-decoration: none;
  padding: 1.05rem 0.15rem;
}

.entry__link:hover .entry__title {
  color: var(--teal-soft);
}

.entry__ref {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-soft);
  white-space: nowrap;
  align-self: baseline;
}

.entry__title {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink);
}

.entry__meta {
  grid-column: 3;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.entry__summary {
  grid-column: 2 / 4;
  grid-row: 2;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (max-width: 26rem) {
  .entry__link {
    grid-template-columns: auto 1fr;
  }
  .entry__meta {
    grid-column: 2;
    grid-row: 2;
  }
  .entry__summary {
    grid-column: 1 / 3;
    grid-row: 3;
  }
}

.entry-list--full .entry__link {
  padding: 1.35rem 0.15rem;
}

/* Page heads */

.page-head {
  margin-bottom: 2.5rem;
  max-width: var(--measure);
}

.page-head h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  margin: 0 0 0.5rem;
}

.page-head__sub {
  color: var(--ink-soft);
  margin: 0;
  font-size: 1rem;
}

/* Standalone article (post / project) */

.back-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  border-bottom: 1px solid transparent;
}

.back-link:hover {
  color: var(--teal-soft);
  border-bottom-color: currentColor;
}

.post {
  max-width: var(--measure);
}

.post__header {
  margin-bottom: 2.5rem;
}

.entry__ref--standalone {
  display: inline-block;
  margin-bottom: 0.9rem;
}

.post__header h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.post__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0;
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

.post__stack {
  color: var(--ink-soft);
}

.post__link {
  margin: 0.6rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.post__link a {
  color: var(--teal-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.post__link a:hover {
  color: var(--bronze);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill--live {
  color: var(--teal);
  border-color: var(--teal);
}

.status-pill--in-testing {
  color: var(--bronze);
  border-color: var(--bronze);
}

/* Prose (rendered markdown body) */

.prose {
  font-size: 1.05rem;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1.35em;
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  margin-top: 2.2em;
  letter-spacing: -0.005em;
}

.prose h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  margin-top: 1.8em;
}

.prose p {
  color: var(--ink);
}

.prose a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

.prose a:hover {
  color: var(--bronze);
  border-bottom-color: currentColor;
}

.prose ul, .prose ol {
  padding-left: 1.35em;
}

.prose li + li {
  margin-top: 0.5em;
}

.prose strong {
  font-weight: 600;
}

.prose blockquote {
  margin: 1.5em 0;
  padding-left: 1.1em;
  border-left: 2px solid var(--teal);
  color: var(--ink-soft);
  font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-raised);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.prose pre {
  background: var(--paper-raised);
  padding: 1em 1.2em;
  border-radius: 6px;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.prose pre code {
  background: none;
  padding: 0;
}

.post--about .prose {
  max-width: var(--measure);
}
