@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #000;
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ===== PAGE TRANSITIONS ===== */

.page-wrapper {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== INDEX — CROSSWORD HERO ===== */

.hero-section {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: #000;
}

.crossword-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.crossword-grid {
  display: grid;
  gap: 0px;
  position: relative;
}

.crossword-grid .c {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.9rem, 2vw, 1.5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid #1a1a1a;
  position: relative;
  background: #000;
  color: transparent;
}

/* Black cell */
.crossword-grid .c.b {
  background: #000;
  border-color: #111;
}

/* Extra white cell (empty, no letter) */
.crossword-grid .c.w {
  background: #fff;
  border-color: #ccc;
}

/* Letter cell (white) */
.crossword-grid .c.l {
  background: #fff;
  color: #000;
  border-color: #ccc;
}

/* Shared cell (intersection) */
.crossword-grid .c.s {
  background: #fff;
  color: #000;
  border-color: #ccc;
}

/* Clue number */
.crossword-grid .c .num {
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: clamp(0.45rem, 0.8vw, 0.65rem);
  font-weight: 500;
  color: #666;
  line-height: 1;
}

/* Word cells — interactive */
.crossword-grid .c[data-word] {
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crossword-grid .c.word-active {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}

/* Drawing canvas — covers full viewport */
#draw-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 20;
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}

/* Hint */
.hint {
  margin-top: 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #333;
  font-weight: 400;
  text-align: center;
}

.hint em {
  font-style: italic;
  color: #555;
}

/* Contact strip */
.contact-strip {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.2rem 3rem;
  display: flex;
  justify-content: flex-start;
  gap: 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: #333;
  z-index: 50;
}

.contact-strip a {
  color: #444;
  transition: color 0.2s;
}

.contact-strip a:hover {
  color: #fff;
}

/* Navigation flash */
.nav-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 1000;
  pointer-events: none;
}

.nav-flash.out {
  animation: flashOut 0.6s ease-out forwards;
}

@keyframes flashOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.nav-flash.in {
  animation: flashIn 0.4s ease-in forwards;
}

@keyframes flashIn {
  0% { opacity: 0; }
  60% { opacity: 1; }
  100% { opacity: 1; }
}

/* ===== ABOUT PAGE ===== */

.about-page {
  min-height: 100vh;
  padding: 4rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: #fff;
}

.back-link .arrow {
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.back-link:hover .arrow {
  transform: translateX(-3px);
}

.about-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 5rem;
  align-items: start;
}

.photo-box {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #111;
  position: relative;
}

.photo-box canvas,
.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-right .section-label {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: #444;
  text-transform: uppercase;
  margin-bottom: 1.8rem;
  font-weight: 500;
}

.about-right .bio {
  font-size: 1.1rem;
  line-height: 1.85;
  color: #aaa;
  font-weight: 300;
}

.about-right .bio strong {
  color: #e0e0e0;
  font-weight: 600;
}

/* ===== PORTFOLIO PAGE ===== */

.portfolio-page {
  min-height: 100vh;
  padding: 4rem 4rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
  background: #000;
}

.portfolio-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3.5rem;
}

.portfolio-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.portfolio-count {
  font-size: 0.7rem;
  color: #444;
  letter-spacing: 0.1em;
  font-weight: 400;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.proj-card {
  background: #fff;
  color: #000;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.proj-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255,255,255,0.06);
}

.proj-card .num {
  font-size: 0.6rem;
  color: #bbb;
  letter-spacing: 0.12em;
  margin-bottom: auto;
  font-weight: 500;
}

.proj-card .name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.proj-card .desc {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.6;
  font-weight: 400;
}

.proj-card .tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.proj-card .tags span {
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: #999;
  border: 1px solid #ddd;
  padding: 0.2rem 0.5rem;
  text-transform: uppercase;
  font-weight: 500;
}

.proj-card .tags span.active-tag {
  border-color: #000;
  color: #000;
}

/* Coord tracker */
.coord {
  position: fixed;
  bottom: 3.5rem;
  right: 2rem;
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: #222;
  font-family: 'Inter', monospace;
  z-index: 50;
  font-weight: 400;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .photo-box {
    max-width: 260px;
  }

  .about-page,
  .portfolio-page {
    padding: 2rem 1.5rem 4rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .portfolio-title {
    font-size: 1.6rem;
  }

  .contact-strip {
    gap: 1.2rem;
    font-size: 0.65rem;
  }
}
