@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,700;0,900;1,400;1,900&display=swap');

:root {
  --paper: #090909;     /* Deep off-black */
  --ink: #e3e3e3;       /* Grungy off-white */
  --dim-ink: #8f8f8f;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  line-height: 1.5;
}

/* SVG Grain Filter mimicking cheap manga paper */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="2.5" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.08"/%3E%3C/svg%3E');
  pointer-events: none;
}

/* Screen tone dots */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background-image: radial-gradient(circle, rgba(227, 227, 227, 0.15) 1px, transparent 1.5px);
  background-size: 6px 6px;
  pointer-events: none;
}

.site-shell {
  padding: 2.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Homepage Title Block */
.logo-block {
  display: inline-block;
  align-self: flex-start;
  padding: 1.2rem 2.5rem;
  border: 6px solid var(--ink);
  background: var(--paper);
  position: relative;
  box-shadow: 12px 12px 0px rgba(0,0,0,0.9);
}
.logo-block::after {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 3px solid var(--ink);
  pointer-events: none;
}
.logo-text {
  font-weight: 900;
  font-style: italic;
  font-size: clamp(2.8rem, 7vw, 5rem);
  text-transform: uppercase;
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0;
}
.tagline {
  font-weight: 900;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.8rem;
  background: var(--ink);
  color: var(--paper);
  display: inline-block;
  padding: 0.3rem 0.6rem;
}

/* Manga Grid */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(220px, auto);
  gap: 12px;
  background: var(--ink); /* Forms the thick gutters between panels */
  border: 6px solid var(--ink);
  padding: 12px;
  box-shadow: 14px 14px 0px rgba(0,0,0,0.9);
}

/* Shared Manga Picture Handling */
.placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Heavy ink filter for standard photos to look like gritty manga panels */
  filter: grayscale(100%) contrast(200%) brightness(0.7);
  transition: all 0.3s cubic-bezier(0.25,1,0.5,1);
}

.manga-tile {
  background-color: var(--paper);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  color: var(--ink);
  cursor: crosshair;
}

/* Toned overlays on tiles */
.manga-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(227,227,227,0.12) 9px);
  z-index: 2;
}

.manga-tile .placeholder-img {
  position: absolute;
  inset: 0;
}

.manga-tile:hover .placeholder-img {
  filter: grayscale(100%) contrast(250%) brightness(1);
  transform: scale(1.05);
}

.manga-caption {
  position: relative;
  z-index: 10;
  background: var(--paper);
  border-top: 4px solid var(--ink);
  border-right: 4px solid var(--ink);
  padding: 0.5rem 1.2rem;
  font-weight: 900;
  font-size: 1.6rem;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  align-self: flex-start;
  margin-top: auto;
  transition: background 0.2s, color 0.2s;
}

.manga-tile:hover .manga-caption {
  background: var(--ink);
  color: var(--paper);
}

/* Asymmetric Manga Panel Positions */
.tile-1 { grid-column: span 7; grid-row: span 2; }
.tile-2 { grid-column: span 5; grid-row: span 3; }
.tile-3 { grid-column: span 7; grid-row: span 1; }
.tile-4 { grid-column: span 5; grid-row: span 2; }
.tile-5 { grid-column: span 7; grid-row: span 2; }

/* Focus States */
.manga-tile.active {
  outline: 8px solid var(--ink);
  outline-offset: -8px;
  z-index: 10;
}
.manga-tile.active .manga-caption {
  background: var(--ink);
  color: var(--paper);
}

/* Sub-page elements */
.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.back {
  font-weight: 900;
  font-style: italic;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  display: inline-block;
  padding: 0.6rem 1.4rem;
  margin-bottom: 2rem;
  border: 4px solid var(--ink);
  text-transform: uppercase;
  font-size: 1.3rem;
  transition: all 0.2s;
  box-shadow: 6px 6px 0px rgba(0,0,0,0.9);
}
.back:hover {
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
  transform: translate(6px, 6px);
}

.page-title {
  font-weight: 900;
  font-size: 4rem;
  font-style: italic;
  text-transform: uppercase;
  margin: 0;
  letter-spacing: -0.04em;
  border-bottom: 6px solid var(--ink);
  line-height: 1;
  padding-bottom: 0.5rem;
  width: 100%;
}

.content-card {
  border: 6px solid var(--ink);
  padding: 3rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 14px 14px 0px rgba(0,0,0,0.9);
  position: relative;
}
/* Inner frame on cards */
.content-card::before {
  content: '';
  position: absolute;
  top: 10px; left: 10px; right: 10px; bottom: 10px;
  border: 3px solid var(--ink);
  pointer-events: none;
}

/* Utility text styles */
.content-card p {
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
}

/* Standard standalone image for info etc */
.content-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  filter: grayscale(100%) contrast(200%) brightness(0.8);
  border: 5px solid var(--ink);
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
  box-shadow: 8px 8px 0px rgba(0,0,0,0.8);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  position: relative;
  z-index: 2;
}

.project-item {
  border: 5px solid var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--paper);
  transition: transform 0.2s;
  box-shadow: 8px 8px 0px rgba(0,0,0,0.9);
}
.project-item:hover {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0px rgba(0,0,0,0.9);
}

.img-wrapper {
  width: 100%;
  height: 250px;
  border-bottom: 5px solid var(--ink);
  background: var(--paper);
  position: relative;
  overflow: hidden;
}
.img-wrapper .placeholder-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.img-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-radial-gradient(circle at 50% 50%, transparent, transparent 5px, rgba(227, 227, 227, 0.15) 6px);
  pointer-events: none;
}

.project-body {
  padding: 1.5rem;
}
.project-item h3 {
  font-weight: 900;
  font-style: italic;
  font-size: 1.8rem;
  text-transform: uppercase;
  margin: 0 0 0.8rem 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.project-item p {
  font-weight: 400;
  font-size: 1.05rem;
  margin: 0;
  color: var(--dim-ink);
}

/* Manga Speech Bubbles */
.speech-bubble {
  position: absolute;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  padding: 0.6rem 1.2rem;
  font-weight: 900;
  font-style: italic;
  font-size: 1.5rem;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  transition: all 0.15s cubic-bezier(0.25,1,0.5,1);
  box-shadow: 6px 6px 0px rgba(0,0,0,0.9);
  letter-spacing: 0.05em;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -18px; left: 20px;
  border-width: 18px 14px 0;
  border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}
.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px; left: 25px;
  border-width: 12px 8px 0;
  border-style: solid;
  border-color: var(--paper) transparent transparent transparent;
  z-index: 1;
}
.manga-tile:hover .speech-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 900px) {
  .manga-grid { grid-template-columns: 1fr; gap: 8px; border-width: 4px; padding: 8px; }
  .tile-1, .tile-2, .tile-3, .tile-4, .tile-5 { grid-column: span 1; grid-row: auto; }
  .manga-tile { height: 300px; border: 4px solid var(--ink); }
  .logo-text { font-size: 3rem; }
  .content-card { padding: 1.5rem; text-align: center; }
}
