:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a2230;
  --muted: #5a6575;
  --accent: #2f3590;
  --on-accent: #ffffff;
  --line: #d9dde3;
  --grid: rgba(47, 53, 144, 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d;
    --surface: #181e27;
    --text: #e7eaef;
    --muted: #9ba5b3;
    --accent: #a3a8ff;
    --on-accent: #12161d;
    --line: #2a313c;
    --grid: rgba(163, 168, 255, 0.08);
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.65;
}

.wrap {
  max-width: 54rem;
  margin: 0 auto;
  padding-left: clamp(1.5rem, 7vw, 2.5rem);
  padding-right: clamp(1.5rem, 7vw, 2.5rem);
}

/* Top bar */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

nav a {
  margin-left: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

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

/* Header with faint chip-floorplan grid */
header {
  padding: 3.5rem 0 3rem;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
}

h1 {
  margin: 0 0 1rem;
  font-size: 2.6rem;
  letter-spacing: -0.01em;
}

.lead {
  max-width: 36rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Sections */
section {
  padding-top: 2.75rem;
}

h2 {
  margin: 0 0 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent);
  font-size: 1.3rem;
}

/* Project rows */
.project {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
}

.project:last-child {
  border-bottom: none;
}

h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.tools {
  margin: 0;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

.desc {
  margin: 0;
}

/* Contact */
.contact {
  padding-bottom: 1rem;
}

.contact p {
  margin: 1rem 0 0;
  max-width: 38rem;
}

.address {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

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

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.12);
}

footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

footer p {
  margin: 0;
}

@media (max-width: 640px) {
  h1 {
    font-size: 2.1rem;
  }

  .project {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}
