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

:root {
  --bg: #fafaf8;
  --text: #0f0f0f;
  --accent: #990000;
  --border: #0f0f0f;
  --muted: #555;
  --dim: #888;
  --link: #0000cc;
  --visited: #551a8b;
  --mono: 'Source Code Pro', monospace;
  --max: 860px;
}

html { scroll-behavior: smooth; scrollbar-gutter: stable; }

* {
  cursor: url(../cur/WiiCursor.cur), default;
}

a, a *,
button, button *,
summary, select,
label, [role="button"],
input[type="button"], input[type="submit"],
input[type="checkbox"], input[type="radio"],
.video-thumb a, .index-link, .nav-links a,
.home-link, #video-close, .btn-link {
  cursor: url(../cur/wii-pointer-blue.cur), pointer;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.75;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 2rem;
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

/* ── NAV ──────────────────────────────────────────── */

.site-nav {
  display: flex;
  align-items: baseline;
  padding-bottom: 0.6rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.home-link {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-right: auto;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border);
}
.home-link:visited { color: var(--text); }
.home-link:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.active {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.nav-cv {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--accent);
  padding: 0.15rem 0.5rem;
  margin-left: 1rem;
  white-space: nowrap;
}
.nav-cv:visited { color: var(--accent); }
.nav-cv:hover {
  background: var(--accent);
  color: #fff;
}

.nav-social {
  display: flex;
  gap: 0.9rem;
  align-items: baseline;
  margin-left: 1.25rem;
}
.nav-social a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
}
.nav-social a:visited { color: var(--muted); }
.nav-social a:hover { color: var(--accent); }

footer {
  margin-top: 0.9rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--dim);
  text-align: center;
}

/* ── TYPOGRAPHY ───────────────────────────────────── */

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.25rem;
}

h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
h2::before { content: '[ '; color: var(--accent); }
h2::after  { content: ' ]'; color: var(--accent); }

h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

p {
  margin-bottom: 0.7rem;
}

ul {
  margin: 0.4rem 0 0.75rem 1.2rem;
}
li { margin-bottom: 0.2rem; }

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 1.5rem 0;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #ebe9e4;
  padding: 0.1em 0.3em;
}

/* ── HOME ─────────────────────────────────────────── */

.hero {
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-sub {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.2rem;
}

.index-links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.index-link {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.25rem;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px dashed #aaa;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
}
.index-link:visited { color: var(--text); }
.index-link:hover { background: rgba(0,0,0,0.025); }
.index-link:hover .index-link-label { color: var(--accent); }

.index-link-label {
  color: var(--muted);
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ── PROJECT ENTRIES ──────────────────────────────── */

.project {
  padding: 1.75rem 0;
  border-bottom: 1px solid #ccc;
}
.project:first-of-type { border-top: none; }
.project:last-of-type { border-bottom: none; }

.project-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.2rem;
}

.project h3 { margin-bottom: 0.2rem; }

.tag {
  font-size: 0.75rem;
  color: var(--dim);
  font-weight: 400;
}

.award {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--accent);
  padding: 0.05em 0.4em;
  margin-left: 0.4em;
  vertical-align: middle;
  white-space: nowrap;
}

.project-desc {
  margin: 0.6rem 0;
}

/* ── MEDIA ────────────────────────────────────────── */

img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #bbb;
}

video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #bbb;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.6rem;
  margin: 0.75rem 0;
}
.media-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.media-grid.cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* ── VIDEO THUMBS ─────────────────────────────────── */

.video-thumb {
  position: relative;
  display: inline-block;
  max-width: 420px;
  border: 1px dashed #bbb;
  padding: 0.35rem;
}
.video-thumb a {
  display: block;
  text-decoration: none;
  position: relative;
}
.video-thumb a::after {
  content: '▶';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: rgba(255,255,255,0);
  transition: color 0.12s;
  pointer-events: none;
}
.video-thumb a:hover::after {
  color: rgba(255,255,255,0.9);
}
.video-thumb a img {
  transition: filter 0.12s;
}
.video-thumb a:hover img {
  filter: brightness(0.75);
}
.video-thumb-label {
  font-size: 0.75rem;
  color: var(--dim);
  margin-top: 0.2rem;
  margin-bottom: 0;
}

/* ── VIDEO OVERLAY ────────────────────────────────── */

#video-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#video-overlay.active { display: flex; }

#video-box {
  width: 92%;
  max-width: 920px;
}

#video-close {
  display: inline-block;
  background: none;
  border: 1px solid #666;
  color: #bbb;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  letter-spacing: 0.05em;
}
#video-close:hover {
  border-color: #ccc;
  color: #fff;
}

#video-iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

/* ── BUTTON LINK ──────────────────────────────────── */

.btn-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid var(--accent);
  padding: 0.15rem 0.5rem;
  margin: 0.75rem 0 0;
}
.btn-link:visited { color: var(--accent); }
.btn-link:hover { background: var(--accent); color: #fff; }

/* ── SMOKE PAGE ───────────────────────────────────── */

.smoke-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.caption {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
  margin-bottom: 0.75rem;
}

/* ── ABOUT PAGE ───────────────────────────────────── */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 2rem;
  align-items: start;
}

.about-photo {
  border: 1px solid #bbb;
  display: block;
  width: 100%;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.contact-list li {
  padding: 0.3rem 0;
  border-bottom: 1px dashed #ccc;
}
.contact-list li:first-child { border-top: 1px dashed #ccc; }

/* ── FOOTER ───────────────────────────────────────── */

/* ── FEATURED GRID (home) ─────────────────────────── */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--border);
  margin: 0.6rem 0 0;
}

.project-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  border-right: 1px solid var(--border);
}
.project-card:last-child { border-right: none; }
.project-card:visited { color: var(--text); }

.project-card-img {
  display: block;
  width: 100%;
  height: 185px;
  object-fit: cover;
  object-position: center;
  border: none;
  border-bottom: 1px solid var(--border);
  transition: filter 0.12s;
}
.project-card:hover .project-card-img { filter: brightness(0.85); }

.project-card-body {
  padding: 0.55rem 0.65rem 0.65rem;
}

.project-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  display: block;
}
.project-card:hover .project-card-name { color: var(--accent); }

.project-card-meta {
  font-size: 0.73rem;
  color: var(--muted);
  display: block;
}

/* ── EDUCATION BUTTONS (home) ─────────────────────── */

.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.6rem 0 0;
}

.edu-btn {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background 0.1s;
}
.edu-btn:visited { color: var(--text); }
a.edu-btn:hover {
  background: rgba(0,0,0,0.03);
}
a.edu-btn:hover .edu-btn-name { color: var(--accent); }

div.edu-btn {
  border-style: dashed;
}

.edu-btn-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.edu-btn-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.edu-btn-tech {
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px dashed #ccc;
  padding-top: 0.35rem;
  margin-top: 0.2rem;
}

/* ── BIO BOX (home) ───────────────────────────────── */

.bio-box {
  display: block;
  width: fit-content;
  margin: 0.9rem auto 0;
  border: 1px dashed #bbb;
  padding: 0.35rem 1.1rem;
  font-size: 0.8rem;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.bio-box:visited { color: var(--dim); }
.bio-box:hover { color: var(--accent); border-color: var(--accent); }

/* ── RESPONSIVE ───────────────────────────────────── */

@media (max-width: 580px) {
  body { padding: 1rem 1rem 3rem; font-size: 13px; }
  .hero-title { font-size: 1.5rem; }
  .index-link { grid-template-columns: 1fr; gap: 0.15rem; }
  .nav-links { gap: 0.75rem; }
  .media-grid.cols-3,
  .media-grid.cols-5 { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 180px; }
  .featured-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .project-card { border-right: none; border-bottom: 1px solid var(--border); }
  .project-card:last-child { border-bottom: none; }
}
