:root {
  --ink: #1B2A4A;
  --ink-soft: #3D4E72;
  --paper: #FAF9F6;
  --paper-dim: #F1EFE8;
  --amber: #C17817;
  --amber-soft: #E3A855;
  --line: rgba(27, 42, 74, 0.18);
  --serif: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.5;
  position: relative;
}

a {
  color: var(--ink);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.hero {
  position: relative;
  z-index: 1;
  padding: 5rem 1.5rem 4rem;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.automaton {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
  margin-bottom: 1.5rem;
}

.automaton .state {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2.5;
}

.automaton .accept-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
}

.automaton .edge {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.75;
}

.automaton .start-edge {
  stroke: var(--amber);
  stroke-width: 2;
}

.automaton .edge-label {
  font-family: var(--mono);
  font-size: 14px;
  fill: var(--ink-soft);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--amber);
  margin: 0 0 0.75rem;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 1.15rem;
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0 0 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--ink-soft);
}

.btn-ghost {
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--paper-dim);
}

main {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--line);
}

.contact {
  border-bottom: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--amber);
  border: 1px solid var(--amber-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0;
}

.about-body p {
  max-width: 64ch;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

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

.course-list li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  align-items: center;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.course-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.course-code {
  font-family: var(--mono);
  color: var(--amber);
  font-size: 0.9rem;
}

.course-name {
  font-size: 1.05rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.skill-group h3 {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}

.skill-group p {
  margin: 0;
  font-size: 1rem;
}

.contact-copy {
  max-width: 56ch;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
}

.contact-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.95rem;
}

.contact-links a {
  text-decoration: none;
  border-bottom: 1.5px solid var(--amber-soft);
  padding-bottom: 0.15rem;
}

.contact-links a:hover {
  border-color: var(--amber);
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 3.5rem 1.25rem 3rem;
  }
}
