/* ================================================================
   RECKLESS ATTEMPTS — Neo-Brutalism B&W
   ================================================================ */

:root {
  --bg: #FFFFFF;
  --fg: #000000;
  --accent-gray: #F5F5F5;
  --muted: #666666;

  --border-thick: 3px;
  --border-medium: 2px;
  --shadow-hard: 8px 8px 0 #000000;
  --shadow-hard-sm: 4px 4px 0 #000000;
  --shadow-hard-lg: 12px 12px 0 #000000;

  --fs-hero: clamp(4rem, 12vw, 10rem);
  --fs-xl:   clamp(2.5rem, 6vw, 5rem);
  --fs-l:    clamp(1.75rem, 3.5vw, 2.5rem);
  --fs-m:    1.25rem;
  --fs-s:    1rem;
  --fs-xs:   0.75rem;

  --font-display: 'Archivo Black', Impact, sans-serif;
  --font-body: 'IBM Plex Sans KR', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-m);
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

html { overflow-x: clip; }

ul { list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ================================================================
   NAV
   ================================================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: var(--bg);
  border-bottom: var(--border-medium) solid var(--fg);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: var(--fs-s);
  letter-spacing: 0.02em;
}

.nav-menu {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav-menu a {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 0.4rem 0.7rem;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

.nav-menu a.active {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

@media (max-width: 767px) {
  .nav {
    padding: 0.75rem 5%;
  }
  .nav-logo {
    font-size: 0.7rem;
  }
  .nav-menu {
    gap: 0.4rem;
  }
  .nav-menu a {
    padding: 0.3rem 0.4rem;
    font-size: 0.6rem;
  }
}

/* ================================================================
   HERO
   ================================================================ */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5%;
  position: relative;
  border-bottom: var(--border-thick) solid var(--fg);
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: var(--fs-m);
  max-width: 30ch;
}

.scroll-hint {
  position: absolute;
  bottom: 6rem;
  left: 5%;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* Marquee */
.marquee {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  overflow: hidden;
  border-top: var(--border-medium) solid var(--fg);
  padding: 0.75rem 0;
  background: var(--fg);
  color: var(--bg);
}

.marquee-track {
  display: flex;
  gap: 1rem;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
  font-family: var(--font-display);
  font-size: var(--fs-s);
  letter-spacing: 0.08em;
}

@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ================================================================
   ABOUT — cinematic stages, one per viewport, scroll-linked dissolve
   ================================================================ */

.about {
  border-bottom: var(--border-thick) solid var(--fg);
  overflow: hidden;
}

/* ---------- Stage: one full viewport, scroll-linked opacity ---------- */
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 7%;
  position: relative;
  opacity: 0;
  will-change: opacity;
}

.stage-heading {
  margin: 0;
  text-align: center;
}

.stage-text {
  text-align: center;
}

/* ---------- Heading size helpers ---------- */
.size-m  { font-family: var(--font-body);    font-weight: 500; font-size: var(--fs-m); line-height: 1.4; }
.size-l  { font-family: var(--font-display); font-size: var(--fs-l);  line-height: 1.05; }
.size-xl { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1.0; letter-spacing: -0.01em; }
.size-hero {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  line-height: 0.92;
  letter-spacing: -0.025em;
}
.size-climax {
  font-family: var(--font-display);
  font-size: clamp(6rem, 28vw, 20rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
}

.muted { color: var(--muted); }

/* ---------- Feature stage: text + evidence card side by side ---------- */
.stage-feature {
  display: grid;
  gap: 3rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  grid-template-columns: 1fr;
}

.evidence {
  margin: 0;
  background: var(--bg);
  border: var(--border-thick) solid var(--fg);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  position: relative;
  transition: transform 0.35s ease-out, box-shadow 0.35s ease-out;
}

.evidence img {
  display: block;
  width: 100%;
  height: auto;
}

.evidence-sm { max-width: 340px; }
.evidence-md { max-width: 460px; }
.evidence-lg { max-width: 540px; }

.tilt-right { transform: rotate(2.5deg); }
.tilt-left  { transform: rotate(-2.8deg); }

.evidence:hover {
  transform: rotate(0deg) translate(-4px, -4px);
  box-shadow: var(--shadow-hard-lg);
}

.evidence.grainy img { filter: contrast(1.05) saturate(0); }
.evidence.grainy::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}

@media (min-width: 768px) {
  .stage-feature {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
  }
  .feature-left-img .evidence       { order: 1; justify-self: end;  }
  .feature-left-img .stage-heading  { order: 2; justify-self: start; text-align: left; }

  .feature-right-img .stage-heading { order: 1; justify-self: end;  text-align: right; }
  .feature-right-img .evidence      { order: 2; justify-self: start; }

  /* Shrink hero-size heading inside 2-column feature layout so Korean doesn't
     wrap one-character-per-line in the narrow column. */
  .stage-feature .size-hero {
    font-size: clamp(3.5rem, 7vw, 5.5rem);
    line-height: 0.95;
  }
  .stage-feature .size-xl {
    font-size: clamp(2rem, 5vw, 4rem);
  }
}

@media (max-width: 767px) {
  .stage-feature { display: flex; flex-direction: column; gap: 2rem; }
  .evidence-lg { max-width: 85%; }
  .evidence-md { max-width: 80%; }
  .evidence-sm { max-width: 60%; }
}

/* ---------- Background-image stages ---------- */
.stage-bg-block {
  padding: 0;
  overflow: hidden;
}

.stage-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.stage-bg-block .stage-heading.on-image {
  position: relative;
  color: var(--bg);
  mix-blend-mode: difference;
  z-index: 1;
  padding: 0 5%;
  pointer-events: none;
}

/* ---------- Reduced motion: stages just appear statically ---------- */
@media (prefers-reduced-motion: reduce) {
  .stage {
    opacity: 1;
    min-height: auto;
    padding: 5rem 7%;
  }
  .stage-bg-block { min-height: 60vh; }
}

/* ================================================================
   PROJECTS
   ================================================================ */

.projects {
  padding: 6rem 5% 8rem;
  border-bottom: var(--border-thick) solid var(--fg);
}

.section-heading {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  margin-bottom: 3rem;
  letter-spacing: -0.02em;
}

/* Mobile first: horizontal snap carousel */
.projects-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 1rem;
  padding: 1rem 0 2rem;
  scrollbar-width: none;
}
.projects-grid::-webkit-scrollbar { display: none; }

.project-card {
  flex: 0 0 85%;
  scroll-snap-align: center;
  aspect-ratio: 1 / 1.1;
  background: var(--bg);
  border: var(--border-thick) solid var(--fg);
  box-shadow: var(--shadow-hard);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out, color 0.15s ease-out;
  color: var(--fg);
  cursor: pointer;
}

.project-card[data-status="coming"] {
  cursor: not-allowed;
  color: var(--fg);
}

.project-card:hover,
.project-card:focus-visible {
  transform: translate(-4px, -4px);
  box-shadow: var(--shadow-hard-lg);
  outline: none;
}

.project-card[data-status="active"]:hover {
  background: var(--fg);
  color: var(--bg);
}
.project-card[data-status="active"]:hover .status-badge {
  background: var(--bg);
  color: var(--fg);
}

.status-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  background: var(--fg);
  color: var(--bg);
  letter-spacing: 0.08em;
}

.card-logo {
  align-self: center;
  width: 55%;
  max-width: 160px;
  margin: 0.5rem auto 0;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fg);
  border: var(--border-medium) solid var(--fg);
  padding: 10%;
}

.card-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.project-card[data-status="active"]:hover .card-logo {
  background: var(--bg);
  border-color: var(--bg);
}

.project-card[data-status="active"]:hover .card-logo img {
  filter: invert(1);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: auto;
}

.card-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-family: var(--font-body);
  font-size: var(--fs-s);
  font-weight: 500;
}

.card-desc {
  font-family: var(--font-body);
  font-size: var(--fs-s);
  line-height: 1.4;
}

.coming-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  transition: opacity 0.15s ease-out;
  pointer-events: none;
}

.coming-overlay span {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: var(--bg);
  letter-spacing: 0.05em;
}

.project-card[data-status="coming"]:hover .coming-overlay,
.project-card[data-status="coming"]:focus-visible .coming-overlay {
  background: rgba(0, 0, 0, 0.92);
  opacity: 1;
}

/* Carousel indicators (mobile) */
.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.carousel-indicators .dot {
  width: 10px;
  height: 10px;
  border: var(--border-medium) solid var(--fg);
  background: var(--bg);
  transition: background 0.15s ease-out;
}

.carousel-indicators .dot.active {
  background: var(--fg);
}

/* Desktop grid */
@media (min-width: 768px) {
  .projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    overflow: visible;
    padding: 1rem 0 2rem;
  }
  .project-card {
    flex: initial;
    aspect-ratio: 1 / 1.1;
    padding: 2rem;
  }
  .carousel-indicators {
    display: none;
  }
}

/* ================================================================
   COFFEE
   ================================================================ */

.coffee {
  padding: 6rem 5% 8rem;
  text-align: center;
  border-bottom: var(--border-thick) solid var(--fg);
}

.coffee-intro {
  font-family: var(--font-body);
  font-size: var(--fs-l);
  margin-bottom: 2rem;
}

.coffee-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-l);
  padding: 1.5rem 3rem;
  background: var(--fg);
  color: var(--bg);
  border: var(--border-thick) solid var(--fg);
  box-shadow: var(--shadow-hard);
  transition: all 0.15s ease-out;
  letter-spacing: 0.02em;
}

.coffee-btn:hover,
.coffee-btn:focus-visible {
  background: var(--bg);
  color: var(--fg);
  transform: translate(-4px, -4px);
  box-shadow: var(--shadow-hard-lg);
  outline: none;
}

.coffee-note {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted);
}

@media (min-width: 768px) {
  .coffee-btn {
    padding: 2rem 4rem;
  }
}

/* ---------- Ko-fi modal ---------- */
.kofi-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.kofi-modal[aria-hidden="false"] {
  display: flex;
}

.kofi-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.kofi-modal-dialog {
  position: relative;
  width: min(95vw, 560px);
  height: min(92vh, 720px);
  background: var(--bg);
  border: var(--border-thick) solid var(--fg);
  box-shadow: var(--shadow-hard-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kofi-modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 44px;
  height: 44px;
  background: var(--fg);
  color: var(--bg);
  border: var(--border-thick) solid var(--fg);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-display);
  z-index: 2;
  padding: 0;
}

.kofi-modal-close:hover,
.kofi-modal-close:focus-visible {
  background: var(--bg);
  color: var(--fg);
  outline: none;
}

.kofi-modal-dialog iframe {
  flex: 1;
  width: 100%;
  border: 0;
  display: block;
}

/* ================================================================
   FOOTER
   ================================================================ */

.footer {
  background: var(--fg);
  color: var(--bg);
  padding: 2rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: var(--fs-s);
}

.footer-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
}

/* ================================================================
   Accessibility — reduced motion
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .scroll-hint,
  .marquee-track {
    animation: none;
  }

  .project-card,
  .coffee-btn {
    transition: none;
  }
}
