/* A separate file rather than a <style> block, so the Content-Security-Policy
   in nginx/default.conf can say style-src 'self' without 'unsafe-inline'. */

:root {
  --bg: #faf8f5;
  --surface: #f2eee8;
  --line: #e5dfd6;
  --line-strong: #cfc7bc;
  --text: #1c1a17;
  --muted: #6b645c;
  --accent: #c2410c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131210;
    --surface: #1c1a17;
    --line: #2a2723;
    --line-strong: #3d3933;
    --text: #ece8e2;
    --muted: #9b948b;
    --accent: #f0874a;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 38rem;
  margin: 0 auto;
  padding: clamp(3rem, 16vh, 9rem) 1rem 4rem;
}

header {
  margin-bottom: 2.25rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 7vw, 2.75rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

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

.tld {
  color: var(--accent);
}

header p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.0625rem;
}

/* ------------------------------------------------------------ projects -- */

.projects {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 1rem;
  align-items: center;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.project:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.project:focus-visible,
.back:focus-visible,
h1 a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.title {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.625rem;
}

.name {
  font-size: 1.0625rem;
  font-weight: 600;
}

.host {
  color: var(--muted);
  font: 0.8125rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.desc {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0.125rem;
  color: var(--muted);
}

.arrow {
  grid-column: 2;
  grid-row: 1 / 3;
  color: var(--muted);
  font-size: 1.125rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.project:hover .arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ----------------------------------------------------------------- 404 -- */

.back {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .project,
  .arrow {
    transition: none;
  }
}
