/* Josh Coffman — computerist.co */

:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --border:       rgba(240, 246, 252, 0.08);
  --border-hover: rgba(240, 246, 252, 0.18);
  --text:         #e6edf3;
  --text-muted:   #8b949e;
  --accent:       #58a6ff;
  --accent-dim:   rgba(88, 166, 255, 0.12);
  --max-width:    860px;
  --nav-height:   60px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  background-image:
    repeating-radial-gradient(
      ellipse 700px 500px at 18% 22%,
      transparent 0px,
      transparent 49px,
      rgba(88, 166, 255, 0.045) 49px,
      rgba(88, 166, 255, 0.045) 50px
    ),
    repeating-radial-gradient(
      ellipse 550px 420px at 82% 68%,
      transparent 0px,
      transparent 39px,
      rgba(88, 166, 255, 0.035) 39px,
      rgba(88, 166, 255, 0.035) 40px
    ),
    repeating-radial-gradient(
      ellipse 400px 320px at 55% 88%,
      transparent 0px,
      transparent 29px,
      rgba(88, 166, 255, 0.025) 29px,
      rgba(88, 166, 255, 0.025) 30px
    );
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Nav ────────────────────────────────────────────── */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(13, 17, 23, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-name {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

#nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

#nav ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}

#nav ul li a:hover {
  color: var(--text);
}

/* ── Hero ───────────────────────────────────────────── */

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-height) + 5rem) 2rem 6rem;
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(88, 166, 255, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 25%, rgba(88, 166, 255, 0.04) 0%, transparent 45%);
  animation: hero-pulse 10s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes hero-pulse {
  from { opacity: 0.5; }
  to   { opacity: 1;   }
}

.hero-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.hero-icon {
  color: var(--accent);
  font-size: 2rem;
  margin-bottom: 1.75rem;
  display: block;
  opacity: 0.85;
}

.hero-inner h1 {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.tagline {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.65;
  margin-bottom: 2.5rem;
}

.hero-links {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.375rem;
  background: var(--accent);
  color: #0d1117;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s;
  letter-spacing: 0.01em;
  font-family: inherit;
}

.btn-primary:hover { opacity: 0.82; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.375rem;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 6px;
  border: 1px solid var(--border-hover);
  text-decoration: none;
  transition: border-color 0.15s;
  letter-spacing: 0.01em;
}

.btn-secondary:hover { border-color: rgba(240, 246, 252, 0.35); }

/* ── Sections ───────────────────────────────────────── */

section {
  padding: 5rem 2rem;
  border-top: 1px solid var(--border);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.75rem;
}

section p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: 640px;
  margin-bottom: 1.125rem;
}

section p:last-of-type { margin-bottom: 0; }

section p strong {
  color: var(--text);
  font-weight: 500;
}

/* ── Credentials grid ───────────────────────────────── */

.credentials-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-hover); }

.card-tag {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.875rem;
}

.card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  letter-spacing: 0;
}

.card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
  max-width: none;
}

.card a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.75rem;
  display: inline-block;
  margin-top: 0.75rem;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.card a:hover { opacity: 1; }

/* ── Posts teaser ───────────────────────────────────── */

.posts-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-top: 1.5rem;
  transition: gap 0.15s;
}

.posts-link:hover { gap: 0.75rem; }

/* ── Contact ────────────────────────────────────────── */

#contact form {
  max-width: 500px;
  margin-top: 0.25rem;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.field input,
.field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5625rem 0.875rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.15s;
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.field input.error,
.field textarea.error {
  border-color: #f85149;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.form-actions {
  display: flex;
  gap: 0.875rem;
  margin-top: 1.25rem;
  align-items: center;
}

.btn-reset {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5625rem 1.125rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-reset:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.social-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
  list-style: none;
}

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s;
}

.social-links a:hover { color: var(--text); }
.social-links a i { font-size: 1rem; }

/* ── Blog: post list ────────────────────────────────── */

.posts-list {
  list-style: none;
  margin-top: 0.25rem;
}

.posts-list li {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.posts-list li:first-child { border-top: 1px solid var(--border); }

.posts-list small {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.posts-list a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 500;
  transition: color 0.15s;
  line-height: 1.4;
}

.posts-list a:hover { color: var(--accent); }

/* ── Blog: single post ──────────────────────────────── */

.post-header {
  margin-bottom: 3rem;
}

.post-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.post-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.post-content {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
  line-height: 1.3;
}

.post-content h2 { font-size: 1.375rem; }
.post-content h3 { font-size: 1.125rem; }
.post-content h4 { font-size: 1rem; }

.post-content p { margin-bottom: 1.5rem; }
.post-content p:last-child { margin-bottom: 0; }

.post-content strong {
  color: var(--text);
  font-weight: 600;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(88, 166, 255, 0.3);
  transition: border-color 0.15s;
}

.post-content a:hover { border-bottom-color: var(--accent); }

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-content li { margin-bottom: 0.5rem; }

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--text);
}

.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
}

.post-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.post-nav a:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

/* ── Page wrapper (blog pages) ──────────────────────── */

.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--nav-height) + 4rem) 2rem 5rem;
}

/* ── Footer ─────────────────────────────────────────── */

footer {
  padding: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

footer p {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0;
  max-width: none;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

footer a:hover { color: var(--text); }

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 640px) {
  .credentials-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .field.full { grid-column: 1; }
  #nav ul { gap: 1.25rem; }
}

@media (max-width: 480px) {
  #nav ul li { display: none; }
  #nav ul li:last-child { display: list-item; }
}
