/* ==========================================================================
   THEME — design tokens
   Cool paper background, teal/ochre accents, grotesk + serif pairing.
   Change values here to re-skin the whole site.
   ========================================================================== */

:root {
  /* color */
  --bg:          #F1F3F1;
  --bg-alt:      #E6EAE7;
  --surface:     #FFFFFF;
  --ink:         #1B2A2E;
  --ink-soft:    #55666A;
  --ink-faint:   #8A9A9D;
  --border:      #D6DCD8;
  --accent:      #2F7A6D;   /* muted teal — links, primary actions */
  --accent-ink:  #FFFFFF;
  --accent-warm: #C97A2E;   /* ochre — secondary highlight */

  /* type */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* layout */
  --wrap: 1080px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 42, 46, 0.04), 0 8px 24px rgba(27, 42, 46, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #14191A;
    --bg-alt:      #1B2122;
    --surface:     #1D2425;
    --ink:         #ECEFEE;
    --ink-soft:    #A9B4B3;
    --ink-faint:   #6E7A79;
    --border:      #2B3334;
    --accent:      #6FBDAB;
    --accent-ink:  #0F1716;
    --accent-warm: #E0A05D;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink); }

.eyebrow, .card-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

::selection { background: var(--accent); color: var(--accent-ink); }

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

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

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.mark-box {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  position: relative;
  display: inline-block;
  padding: 0.4rem 0.1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
  transition: right 0.2s ease;
}

.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }

.site-nav a.active {
  color: var(--ink);
  font-weight: 500;
}
.site-nav a.active::after { right: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ==========================================================================
   Main content
   ========================================================================== */

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

.hero {
  max-width: 680px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.hero .eyebrow { display: block; margin-bottom: 1rem; }

.hero .lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

.hero .tag-list { margin-bottom: 1.5rem; }

/* Card grid — used for linking out to different sections/apps of the site */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.card h2 {
  font-size: 1.15rem;
  margin: 0.5rem 0 0.4rem;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

.project-thumb {
  height: 96px;
  border-radius: 8px;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.back-link:hover { color: var(--accent); }

/* Generic building blocks for extending pages */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.88; }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.prose { max-width: 68ch; }
.prose p { color: var(--ink-soft); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.message-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.message {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.message-error {
  border-color: #b44b4b;
  background: #fff7f7;
  color: #7a2626;
}

.message-success {
  border-color: #4b8a63;
  background: #f4fbf7;
  color: #245436;
}

.section-heading {
  margin-top: 3rem;
  margin-bottom: 1.25rem;
}

.section-heading:first-child { margin-top: 0; }

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

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.footer-inner p { margin: 0; color: var(--ink-faint); }

.to-top { color: var(--ink-faint); transition: color 0.15s ease; }
.to-top:hover { color: var(--accent); }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav.open { max-height: 320px; }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1.25rem;
  }

  .site-nav a {
    display: block;
    padding: 0.65rem 0;
  }

  .site-nav a::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}