/* ============================================================
   Ember & Ink — a warm dark theme for nick.allbritton.dev
   ============================================================ */

:root {
  /* Core palette */
  --bg:            #1A1210;
  --surface:       #241A16;
  --surface-2:     #2E211C;
  --border:        #4A342A;

  --text:          #F5E6D3;
  --text-muted:    #B8A08E;
  --text-dim:      #8A7466;

  --accent:        #E6B450;  /* gold — links, primary actions */
  --accent-hover:  #F2C96B;
  --accent-2:      #D97A3A;  /* orange — buttons, badges */
  --danger:        #C44536;  /* red — sparing use */

  /* Derived */
  --selection-bg:  #D97A3A;
  --selection-fg:  #1A1210;

  /* Type */
  --font-display:  "Fraunces", Georgia, serif;
  --font-body:     "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:     "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure:       68ch;
  --radius:        6px;
  --radius-lg:     10px;
}

/* ------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------ */

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

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(ellipse 1200px 800px at 50% -10%,
                    rgba(46, 33, 28, 0.9) 0%,
                    rgba(26, 18, 16, 1) 55%,
                    rgba(18, 16, 14, 1) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

/* ------------------------------------------------------------
   Layout shell
   ------------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
  width: 100%;
}

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

.site-title:hover {
  color: var(--accent-hover);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.site-nav a:hover {
  color: var(--accent);
}

.site-main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  width: 100%;
}

.site-footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  width: 100%;
  font-size: 0.875rem;
  color: var(--text-dim);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-sep {
  color: var(--border);
}

/* ------------------------------------------------------------
   Typography
   ------------------------------------------------------------ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 2.5rem 0 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-top: 0;
}

h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p {
  margin: 1rem 0;
  max-width: var(--measure);
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   Links
   ------------------------------------------------------------ */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(230, 180, 80, 0.35);
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

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

/* ------------------------------------------------------------
   Cards (for projects, games, thought listings)
   ------------------------------------------------------------ */

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  margin: 1.25rem 0;
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.card:hover {
  background: var(--surface-2);
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.35rem;
}

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

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.card-meta {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(217, 122, 58, 0.15);
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------
   Code
   ------------------------------------------------------------ */

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.1em 0.4em;
  color: var(--accent-hover);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.55;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
}

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

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

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

button, .button {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

button:hover, .button:hover {
  background: var(--surface-2);
  border-color: var(--accent-2);
  color: var(--accent-hover);
}

button.primary, .button.primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: var(--bg);
}

button.primary:hover, .button.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

/* ------------------------------------------------------------
   Blog / thoughts
   ------------------------------------------------------------ */

.thought-meta {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.thought-list {
  list-style: none;
  padding: 0;
}

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

.thought-list li:last-child {
  border-bottom: none;
}

.thought-list a {
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
}

.thought-list .date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

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

article p {
  max-width: none;
}

/* ------------------------------------------------------------
   Games
   ------------------------------------------------------------ */

.game-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin: 1.5rem 0;
}

.game-frame canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--bg);
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 600px) {
  body { font-size: 16px; }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: 1.5rem;
  }

  .site-nav { gap: 1rem; }

  .site-main { padding-top: 1rem; }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
