/* erikimh.com — Erik M. Soroka */

:root {
  --bg:        #ffffff;
  --bg-subtle: #f6f7f9;
  --bg-code:   #f2f4f7;
  --fg:        #16181d;
  --fg-muted:  #5c6472;
  --fg-faint:  #8b93a1;
  --rule:      #e3e6eb;
  --accent:    #1b5e9c;
  --accent-fg: #ffffff;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --measure: 68ch;
  --gutter:  clamp(1.25rem, 5vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0f1115;
    --bg-subtle: #161920;
    --bg-code:   #1a1e26;
    --fg:        #e6e8ec;
    --fg-muted:  #a2aab8;
    --fg-faint:  #6f7787;
    --rule:      #262b34;
    --accent:    #6fb3f2;
    --accent-fg: #0f1115;
  }
}

:root[data-theme="dark"] {
  --bg:        #0f1115;
  --bg-subtle: #161920;
  --bg-code:   #1a1e26;
  --fg:        #e6e8ec;
  --fg-muted:  #a2aab8;
  --fg-faint:  #6f7787;
  --rule:      #262b34;
  --accent:    #6fb3f2;
  --accent-fg: #0f1115;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap-wide { max-width: 82ch; }

/* ---------- links ---------- */

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding-block: 1.1rem;
  margin-bottom: 3.5rem;
}

.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.masthead__name {
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.masthead nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.94rem;
}

.masthead nav a { color: var(--fg-muted); text-decoration: none; }
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--fg); }

/* ---------- typography ---------- */

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 650;
  margin-block: 2.5rem 0.85rem;
}

h1 { font-size: clamp(1.85rem, 4.5vw, 2.4rem); margin-top: 0; }
h2 { font-size: 1.32rem; }
h3 { font-size: 1.08rem; }

p, ul, ol { margin-block: 0 1.15rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-block: 0.3rem; }

strong { font-weight: 640; }

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

/* ---------- code ---------- */

pre {
  background: var(--bg-code);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.855rem;
  line-height: 1.55;
  margin-block: 0 1.3rem;
  tab-size: 4;
}

pre code { background: none; padding: 0; font-size: inherit; }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-code);
  padding: 0.14em 0.38em;
  border-radius: 3px;
}

blockquote {
  margin: 0 0 1.3rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--rule);
  color: var(--fg-muted);
}

/* ---------- article ---------- */

.article__meta {
  color: var(--fg-faint);
  font-size: 0.88rem;
  margin-bottom: 2.25rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: 100px;
  color: var(--fg-muted);
}

.notice {
  background: var(--bg-subtle);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  color: var(--fg-muted);
  margin-block: 0 2.5rem;
}

.notice p:last-child { margin-bottom: 0; }

/* ---------- archive index ---------- */

.archive__group { margin-bottom: 2.75rem; }

.archive__group h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--fg-faint);
  font-weight: 600;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  margin-block: 0 1rem;
}

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

.archive__list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.42rem;
  margin: 0;
}

.archive__list time {
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  flex: 0 0 3.2rem;
}

.archive__list a { text-decoration: none; color: var(--fg); }
.archive__list a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- homepage ---------- */

.hero { text-align: center; }

.hero__portrait {
  width: 140px;
  height: auto;
  display: block;
  margin: 0 auto 1.1rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 6vw, 2.9rem);
  margin-bottom: 0.4rem;
}

.contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.contact li { margin: 0; }

.contact a {
  display: inline-flex;
  color: var(--fg-muted);
  padding: 0.4rem;
  margin: -0.4rem;          /* keeps a 44px tap target without shifting layout */
  border-radius: 6px;
  transition: color 0.15s ease;
}

.contact a:hover,
.contact a:focus-visible { color: var(--accent); }

.contact svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}


.hero__role {
  font-size: 1.08rem;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

.hero__blurb {
  font-size: 1.06rem;
  text-align: left;
}

.section__sub {
  color: var(--fg-faint);
  font-size: 0.9rem;
  margin-top: -0.4rem;
  margin-bottom: 1.5rem;
}

.scope {
  list-style: none;
  padding: 0;
  margin-bottom: 1.4rem;
}

.scope li {
  padding-left: 1.15rem;
  position: relative;
  margin-block: 0.42rem;
}

.scope li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 1px;
  background: var(--fg-faint);
}

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

.role {
  padding-left: 1.15rem;
  border-left: 2px solid var(--rule);
  padding-bottom: 1.15rem;
  margin: 0;
  position: relative;
}

.role:last-child { padding-bottom: 0; }

.role::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.6rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.role__title { font-weight: 620; }

.role__span {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.role__len { color: var(--fg-faint); }

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

.footer {
  border-top: 1px solid var(--rule);
  margin-top: 5rem;
  padding-block: 2rem 3.5rem;
  color: var(--fg-faint);
  font-size: 0.88rem;
}

.footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer a { color: var(--fg-muted); }

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

img, svg, video { max-width: 100%; height: auto; }

table { border-collapse: collapse; width: 100%; margin-bottom: 1.3rem; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 620; }

.table-scroll { overflow-x: auto; margin-bottom: 1.3rem; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .archive__list li { flex-wrap: wrap; gap: 0.35rem; }
  .archive__list time { flex-basis: 100%; }
}
