@font-face {
  font-family: 'Comico';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/Comico-Regular.otf') format('opentype');
}

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

:root {
  --bg:         #fffded;
  --black:      #111111;
  --blue:       #24408e;
  --blue-dim:   rgba(36, 64, 142, 0.18);
  --blue-faint: rgba(36, 64, 142, 0.07);
  --header-h:   120px;
  --nav-h:      63px;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 14px;
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* subpages: scroll inside .page-wrapper, not body */

/* ══ NOTEBOOK GRID ══ */
body {
  font-family: 'Comico', cursive;
  color: var(--black);
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    /* major grid lines */
    linear-gradient(var(--blue-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-dim) 1px, transparent 1px),
    /* minor grid lines */
    linear-gradient(var(--blue-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-faint) 1px, transparent 1px);
  background-size:
    40px 40px,
    40px 40px,
    8px  8px,
    8px  8px;
}

/* ══ HEADER ══ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  padding: 12px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid var(--blue-dim);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--blue-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-dim) 1px, transparent 1px),
    linear-gradient(var(--blue-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-faint) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  font-family: 'Bahiana', cursive;
  font-size: 5.5rem;
  text-decoration: none;
  line-height: 1;
  letter-spacing: 2px;
}

.logo span.port  { color: var(--black); }
.logo span.folio { color: var(--black); }

.sub-header {
  font-size: 1.1rem;
  color: var(--blue);
  opacity: 0.85;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.game-link {
  font-size: 1.4rem;
  opacity: 0.35;
  text-decoration: none;
  transition: opacity 0.2s;
  line-height: 1;
  filter: sepia(1) saturate(3) hue-rotate(195deg) brightness(0.6);
}

.game-link:hover { opacity: 0.85; }

.year-tag {
  font-family: 'Comico', cursive;
  font-size: 1.3rem;
  color: var(--blue);
  font-weight: 700;
  /* align baseline with logo text */
  padding-top: 6px;
  white-space: nowrap;
}

/* ══ BOTTOM NAV ══ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  border-top: 2px solid var(--blue-dim);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--blue-dim) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-dim) 1px, transparent 1px),
    linear-gradient(var(--blue-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--blue-faint) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 8px 8px, 8px 8px;
}

.bottom-nav a {
  font-family: 'Comico', cursive;
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--black);
  opacity: 0.4;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  padding: 18px 36px;
  border-right: 1px solid var(--blue-dim);
  position: relative;
}

.bottom-nav a:first-child { border-left: 1px solid var(--blue-dim); }

.bottom-nav a:hover,
.bottom-nav a.active {
  opacity: 1;
  color: var(--blue);
  background: rgba(36, 64, 142, 0.04);
}

/* ══ HERO ══ */
.hero {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: var(--nav-h);
  overflow: hidden;
  background: var(--bg);
}

.walkcycle-gif {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  mix-blend-mode: multiply;
  transform: scaleX(-1);
}

/* ══ SUBPAGE WRAPPER ══ */
.page-wrapper {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: var(--nav-h);
  padding: 32px 48px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.35s ease both;
}

/* ══ WIP LABEL ══ */
.wip-label {
  position: absolute;
  top: 19%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: 'Comico', cursive;
  font-size: 2rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--blue);
  opacity: 0.5;
  white-space: nowrap;
  pointer-events: none;
}

/* ══ COMING SOON ══ */
.coming-soon {
  font-family: 'Bahiana', cursive;
  font-size: 4rem;
  color: var(--blue);
  opacity: 0.25;
  text-align: center;
  margin-top: 12vh;
  letter-spacing: 4px;
}

/* ══ EASTER EGG ══ */
.easter-egg {
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
  cursor: default;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page headings ── */
.page-title {
  font-family: 'Bahiana', cursive;
  font-size: 3.8rem;
  color: var(--black);
  margin-bottom: 4px;
  line-height: 1;
}

.page-title span { color: var(--blue); }

.page-subtitle {
  font-size: 1.1rem;
  color: var(--black);
  opacity: 0.45;
  margin-bottom: 48px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* ── Divider line ── */
.page-wrapper::before {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--blue);
  margin-bottom: 40px;
  margin-top: -20px;
}

/* ══ GALLERY GRID ══ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
}

.gallery-item {
  background: var(--bg);
  border: 1px solid var(--blue-dim);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s, z-index 0s;
  cursor: pointer;
  position: relative;
}

.gallery-item:hover {
  transform: scale(1.02) rotate(-0.5deg);
  box-shadow: 0 8px 32px rgba(36, 64, 142, 0.14);
  z-index: 10;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.gallery-item .item-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: rgba(36, 64, 142, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--black);
  opacity: 0.3;
  letter-spacing: 1px;
}

.gallery-item .item-caption {
  padding: 10px 14px;
  font-size: 1.2rem;
  color: var(--black);
  border-top: 1px solid var(--blue-dim);
}

/* ══ VIDEO GRID ══ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2px;
}

.video-item {
  background: var(--bg);
  border: 1px solid var(--blue-dim);
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s;
}

.video-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 32px rgba(36, 64, 142, 0.14);
  z-index: 10;
}

.video-item .thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--black);
  overflow: hidden;
}

.video-item .play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  color: var(--bg);
  opacity: 0.7;
}

.video-item .item-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: rgba(36, 64, 142, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-item .thumb-wrap iframe,
.video-item .thumb-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-item .item-caption {
  padding: 10px 14px;
  font-size: 1.2rem;
  color: var(--black);
  border-top: 1px solid var(--blue-dim);
}

/* ══ ABOUT PAGE ══ */
.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  align-items: start;
  max-width: 860px;
}

.about-portrait {
  aspect-ratio: 3/4;
  background: rgba(36, 64, 142, 0.04);
  border: 2px solid var(--blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--black);
  overflow: hidden;
  position: relative;
}

.about-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.about-text h2 {
  font-family: 'Bahiana', cursive;
  font-size: 2.6rem;
  color: var(--black);
  margin-bottom: 20px;
}

.about-text h2 span { color: var(--blue); }

.about-text p {
  font-size: 1.3rem;
  line-height: 1.75;
  color: var(--black);
  margin-bottom: 18px;
  opacity: 0.8;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.skill-tag {
  background: transparent;
  border: 1.5px solid var(--blue-dim);
  padding: 5px 14px;
  font-size: 1.05rem;
  color: var(--black);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  cursor: default;
  text-decoration: none;
  font-family: 'Comico', cursive;
  display: inline-block;
}

.skill-tag:hover {
  background: var(--blue);
  color: var(--bg);
  border-color: var(--blue);
  cursor: pointer;
}

.sketch-line {
  display: inline-block;
  position: relative;
}

.sketch-line::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: -2px;
  right: -2px;
  height: 2.5px;
  background: var(--blue);
  border-radius: 1px;
  transform: rotate(-0.4deg);
}

.contact-links {
  display: flex;
  gap: 20px;
  margin-top: 28px;
}

.contact-link {
  font-size: 1.2rem;
  color: var(--blue);
  text-decoration: none;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 1px;
  transition: opacity 0.18s;
}

.contact-link:hover { opacity: 0.55; }

/* Animation featured */
.gallery-grid.anim-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.gallery-item.featured { grid-column: span 2; }
.gallery-item.featured .item-placeholder { aspect-ratio: 16/9; }

@media (max-width: 640px) {
  :root {
    --header-h: 80px;
    --nav-h:    52px;
  }

  .site-header {
    padding: 10px 16px;
  }

  .logo {
    font-size: 3.2rem;
  }

  .sub-header {
    font-size: 0.8rem;
    letter-spacing: 2px;
  }

  .year-tag {
    font-size: 0.85rem;
  }

  .header-right {
    gap: 6px;
  }

  .game-link {
    font-size: 1rem;
  }

  .wip-label {
    font-size: 1.1rem;
    letter-spacing: 2px;
    left: 50%;
    top: 13%;
  }

  .walkcycle-gif {
    object-fit: contain;
    object-position: center bottom;
    transform: scaleX(-1) scale(2.7);
    transform-origin: center bottom;
  }


  .bottom-nav {
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .bottom-nav::-webkit-scrollbar { display: none; }

  .bottom-nav a {
    padding: 14px 20px;
    font-size: 0.85rem;
    letter-spacing: 1px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .gallery-item.featured { grid-column: span 1; }
  .about-layout { grid-template-columns: 1fr; }

  .page-wrapper {
    padding: 24px 16px;
  }
}
