/* ============================================================
   ericreilly.com — design system
   ============================================================ */

:root {
  --accent: #6AA6FF;
  --bg: #0B0C0E;
  --bg-2: #111317;
  --fg: #E6E8EB;
  --fg-dim: #8A8F98;
  --fg-dimmer: #565A62;
  --line: #1E2127;
  --line-2: #2A2E36;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* grid backdrop */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 0%, transparent 80%);
  opacity: 0.35;
}

.wrap {
  position: relative; z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 32px 96px;
}

/* ============ NAV ============ */
nav.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-dim);
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 70%, transparent);
}
.brand b { font-weight: 600; }
.brand span.path { color: var(--fg-dim); }
.nav-links {
  display: inline-flex; gap: 22px;
  font-family: var(--mono);
  font-size: 13px;
}
.nav-links a {
  text-decoration: none;
  color: var(--fg-dim);
  transition: color .15s ease;
  position: relative;
  padding: 2px 0;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--fg); }
.nav-links a.active::before {
  content: "> ";
  color: var(--accent);
}

/* ============ HERO ============ */
header.hero { padding: 64px 0 40px; }
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 0 0 28px;
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before {
  content: "";
  width: 28px; height: 1px; background: var(--fg-dimmer);
  display: inline-block;
}
h1.headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 7.2vw, 92px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  max-width: 18ch;
}
h1.headline .token {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
  font-size: 0.62em;
  padding: 0.04em 0.24em;
  margin: 0 0.04em;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 6px;
  vertical-align: 0.18em;
  white-space: nowrap;
}
h1.headline .cursor {
  display: inline-block;
  width: 0.52ch;
  height: 0.82em;
  background: var(--fg);
  margin-left: 4px;
  transform: translateY(4px);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.sub {
  font-size: 17px;
  color: var(--fg-dim);
  max-width: 60ch;
  margin: 0 0 32px;
  line-height: 1.6;
}
.sub .token {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.88em;
  padding: 0.04em 0.32em;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 5px;
  white-space: nowrap;
}

/* ============ SECTIONS ============ */
section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 0 0 28px;
  display: flex; align-items: center; gap: 14px;
}
.section-label::before {
  content: "";
  width: 8px; height: 8px; background: var(--accent); border-radius: 2px;
}
.section-label .num {
  margin-left: auto;
  color: var(--fg-dimmer);
  font-weight: 400;
}

/* ============ BODY TYPE ============ */
.lede {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 20px;
  max-width: 28ch;
}
.prose p {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--fg-dim);
  line-height: 1.7;
  margin: 0 0 16px;
  max-width: 68ch;
}
.prose p strong { color: var(--fg); font-weight: 500; }

/* ============ SIDE-BY-SIDE LAYOUT ============ */
.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 72px;
  align-items: start;
}
.side {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.7;
}
.side dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.side dt {
  color: var(--fg-dimmer);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.side dd {
  margin: 2px 0 0;
  color: var(--fg);
}
.side a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dashed var(--line-2);
  padding-bottom: 1px;
  transition: border-color .15s ease, color .15s ease;
}
.side a:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 760px) { .split { grid-template-columns: 1fr; gap: 32px; } }

/* ============ LIST ROWS ============ */
.rows { display: grid; gap: 0; border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
}
.row .n {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dimmer);
  letter-spacing: 0.05em;
  padding-top: 6px;
}
.row .title {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--fg);
}
.row .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  margin: 0 0 10px;
}
.row .meta .sep { color: var(--fg-dimmer); margin: 0 6px; }
.row .meta .status { color: var(--accent); }
.row .desc {
  font-size: 14.5px;
  color: var(--fg-dim);
  max-width: 64ch;
  line-height: 1.6;
  margin: 0 0 12px;
}
.row ul.bullets {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.row ul.bullets li {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
  max-width: 64ch;
}
.row ul.bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--fg-dimmer);
}
.row .right {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  text-align: right;
  white-space: nowrap;
  padding-top: 6px;
}
.row .right a {
  text-decoration: none;
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.row .right a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.row .right a + a { margin-left: 6px; }
.row .why {
  margin-top: 14px;
  padding: 12px 0 0;
  border-top: 1px dashed var(--line-2);
  max-width: 64ch;
}
.row .why-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dimmer);
  margin-bottom: 6px;
}
.row .why p {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.6;
  margin: 0;
}
@media (max-width: 700px) {
  .row { grid-template-columns: 1fr; }
  .row .n { padding-top: 0; font-size: 11px; }
  .row .right { text-align: left; }
}

/* ============ GRID CARDS (for skills etc) ============ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 2px;
}
.grid-2 > .cell {
  background: var(--bg);
  padding: 22px 24px;
}
.cell h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.cell p {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.6;
  margin: 0;
}
@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ============ BULLETED HIGHLIGHTS (about) ============ */
.highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  counter-reset: h;
}
.highlights li {
  font-size: 15.5px;
  color: var(--fg);
  line-height: 1.6;
  padding-left: 48px;
  position: relative;
  max-width: 70ch;
  counter-increment: h;
}
.highlights li::before {
  content: "0" counter(h);
  position: absolute;
  left: 0; top: 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dimmer);
  letter-spacing: 0.05em;
}

/* ============ CONTACT FORM ============ */
.form-intro {
  font-size: 17px;
  color: var(--fg-dim);
  max-width: 60ch;
  line-height: 1.6;
  margin: 0 0 36px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 28px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.field label .req { color: var(--accent); }
.field input,
.field textarea,
.field select {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: color-mix(in oklab, var(--fg) 25%, var(--line-2)); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.field textarea { resize: vertical; min-height: 120px; font-family: var(--sans); }
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%238A8F98' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-dimmer); }
.submit-btn {
  margin-top: 24px;
  background: var(--accent);
  color: #0B0C0E;
  border: 0;
  border-radius: 8px;
  padding: 14px 24px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .08s ease, filter .15s ease, gap .15s ease;
}
.submit-btn:hover { filter: brightness(1.06); gap: 14px; }
.submit-btn:active { transform: translateY(1px); }
.submit-btn:disabled { opacity: .5; cursor: wait; }
.form-message {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}
.form-message.success {
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--fg);
}
.form-message.error {
  background: color-mix(in oklab, #F08A7A 12%, transparent);
  border: 1px solid color-mix(in oklab, #F08A7A 40%, transparent);
  color: #F0B4A9;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

/* ============ HERO LINKS (multi-line) ============ */
.hero-links {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}
.hero-links li { display: block; }
.hero-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--fg);
  text-decoration: none;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, color .2s ease;
  box-shadow: 0 1px 0 color-mix(in oklab, var(--fg) 4%, transparent) inset;
}
.hero-links a .label {
  color: var(--fg);
  font-weight: 500;
}
.hero-links a .label em {
  font-style: italic;
  color: var(--fg);
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  padding: 1px 6px;
  border-radius: 3px;
}
.hero-links a::after {
  content: "→";
  color: var(--accent);
  font-size: 15px;
  display: inline-block;
  transition: transform .2s ease;
}
.hero-links a:hover {
  background: color-mix(in oklab, var(--accent) 8%, var(--bg-2));
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line-2));
  transform: translateY(-1px);
}
.hero-links a:hover::after {
  transform: translateX(3px);
}
.hero-links a:active {
  transform: translateY(0);
}

/* first link = primary: filled accent */
.hero-links li:first-child a {
  background: var(--accent);
  color: #0B0C0E;
  border-color: var(--accent);
  box-shadow: 0 4px 20px -6px color-mix(in oklab, var(--accent) 60%, transparent);
}
.hero-links li:first-child a .label { color: #0B0C0E; font-weight: 600; }
.hero-links li:first-child a::after { color: #0B0C0E; }
.hero-links li:first-child a:hover {
  filter: brightness(1.08);
  background: var(--accent);
  border-color: var(--accent);
}

/* ============ CTA BLOCK ============ */
section.cta {
  padding: 72px 0;
  border-top: 1px solid var(--line);
}
.cta-inner {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 56px 48px;
  background:
    radial-gradient(ellipse 100% 140% at 90% 0%, color-mix(in oklab, var(--accent) 9%, transparent) 0%, transparent 60%),
    var(--bg-2);
  overflow: hidden;
}
.cta-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 60% 80% at 100% 100%, black 0%, transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}
.cta-inner > * { position: relative; }
.cta-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  margin-bottom: 24px;
}
.cta-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.7); }
}
.cta-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.8vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  max-width: 18ch;
  color: var(--fg);
}
.cta-title .token {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--accent);
  font-size: 0.62em;
  padding: 0.04em 0.24em;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 35%, transparent);
  border-radius: 6px;
  vertical-align: 0.2em;
  white-space: nowrap;
}
.cta-sub {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--fg-dim);
  line-height: 1.6;
  max-width: 58ch;
  margin: 0 0 32px;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #0B0C0E;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 14px 24px;
  border-radius: 8px;
  transition: gap .15s ease, filter .15s ease, transform .08s ease;
}
.cta-btn:hover { filter: brightness(1.06); gap: 14px; }
.cta-btn:active { transform: translateY(1px); }
@media (max-width: 600px) {
  .cta-inner { padding: 36px 28px; }
}

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
footer a { text-decoration: none; color: inherit; }
footer a:hover { color: var(--fg); }
footer .accent { color: var(--accent); }

/* ============ REVEAL ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.reveal { animation: fadeUp .6s ease both; }
header.hero.reveal { animation-delay: .05s; }
section.reveal:nth-of-type(1) { animation-delay: .1s; }
section.reveal:nth-of-type(2) { animation-delay: .15s; }
section.reveal:nth-of-type(3) { animation-delay: .2s; }
section.reveal:nth-of-type(4) { animation-delay: .25s; }
