/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

textarea {
  resize: vertical;
}

/* ==========================================================================
   Custom styles
   ========================================================================== */

:root {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-secondary: #555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e5e5;
  --quote-bg: #f5f5f5;
  --quote-border: #d4d4d4;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f0f;
    --text: #e5e5e5;
    --text-secondary: #a3a3a3;
    --accent: #60a5fa;
    --accent-hover: #93bbfd;
    --border: #2a2a2a;
    --quote-bg: #1a1a1a;
    --quote-border: #333;
  }
}

:root[data-theme="dark"] {
  --bg: #0f0f0f;
  --text: #e5e5e5;
  --text-secondary: #a3a3a3;
  --accent: #60a5fa;
  --accent-hover: #93bbfd;
  --border: #2a2a2a;
  --quote-bg: #1a1a1a;
  --quote-border: #333;
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --text: #1a1a1a;
  --text-secondary: #555;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e5e5;
  --quote-bg: #f5f5f5;
  --quote-border: #d4d4d4;
}

* {
  box-sizing: border-box;
}

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

/* Theme toggle */

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease;
  z-index: 10;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text-secondary);
}

/* Show sun in dark mode, moon in light mode */
.icon-sun { display: none; }
.icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

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

:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }

/* Layout */

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

/* Hero */

.hero {
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* About */

.about {
  margin-bottom: 2.5rem;
}

.about p {
  margin: 0 0 1rem;
}

.about p:first-child {
  font-size: 1.15rem;
  font-weight: 500;
}

.quote {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Focus areas */

.focus {
  margin-bottom: 2.5rem;
}

.focus h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.focus ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.focus li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

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

/* Motto */

.motto {
  margin-bottom: 2.5rem;
}

.motto blockquote {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 0;
  background: var(--quote-bg);
  border-radius: 0 4px 4px 0;
}

/* Links */

.links {
  margin-bottom: 3rem;
}

.links h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.links nav {
  display: flex;
  gap: 1.5rem;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

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

/* Footer */

footer {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

footer p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* General links */

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

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

/* ==========================================================================
   Helper classes
   ========================================================================== */

.hidden,
[hidden] {
  display: none !important;
}

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

.invisible {
  visibility: hidden;
}

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

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

@media only screen and (max-width: 480px) {
  .container {
    padding: 2.5rem 1.25rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .links nav {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  .theme-toggle {
    display: none;
  }
}
