/* ============================================
   Ben Moyes — Portfolio
   Minimal, clean design inspired by leerob.com
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Light theme (default) */
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --text: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --link: #111827;
  --link-hover: #3b82f6;
  --border: #e5e7eb;
  --hover-bg: #f3f4f6;
}

[data-theme='dark'] {
  --bg: #111111;
  --bg-secondary: #1a1a1a;
  --text: #e5e5e5;
  --text-secondary: #a3a3a3;
  --text-tertiary: #737373;
  --link: #e5e5e5;
  --link-hover: #60a5fa;
  --border: #262626;
  --hover-bg: #1f1f1f;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* --- Layout --- */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Navigation --- */
header {
  padding: 2rem 0 0;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-home {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.nav-home:hover {
  color: var(--text);
}

/* --- Theme Toggle --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--text);
  background-color: var(--hover-bg);
}

/* Show/hide sun/moon icons based on theme */
.icon-moon { display: none; }
.icon-sun  { display: block; }

[data-theme='dark'] .icon-moon { display: block; }
[data-theme='dark'] .icon-sun  { display: none; }

/* --- Banner --- */
.banner {
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

/* --- Main Content --- */
main {
  padding: 4rem 0 2rem;
}

/* --- Intro --- */
.intro {
  margin-bottom: 3rem;
}

.intro h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* --- About --- */
.about {
  margin-bottom: 3rem;
}

.about p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

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

/* --- Sections (Work, Writing, Connect) --- */
h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
}

.work,
.writing {
  margin-bottom: 3rem;
}

/* --- Work List --- */
.work-list,
.writing-list {
  list-style: none;
}

.work-list li,
.writing-list li {
  border-bottom: 1px solid var(--border);
}

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

.work-list a,
.writing-list a {
  display: block;
  padding: 1rem 0;
  text-decoration: none;
  color: var(--text);
  transition: background-color 0.15s ease;
}

.work-list a:hover,
.writing-list a:hover {
  color: var(--link-hover);
}

.work-title,
.writing-title {
  display: block;
  font-weight: 500;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.work-desc {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --- Writing List --- */
.writing-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.writing-date {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* --- Connect --- */
.connect {
  margin-bottom: 3rem;
}

.connect p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.connect a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.connect a:hover {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

/* --- Footer --- */
footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
}

footer p {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .intro h1 {
    font-size: 1.625rem;
  }

  main {
    padding: 3rem 0 1.5rem;
  }
}

@media (min-width: 768px) {
  main {
    padding: 6rem 0 3rem;
  }

  header {
    padding: 2.5rem 0 0;
  }
}
