/* ============================================================
   Han — hobby portfolio
   Fonts: Space Grotesk (display/UI), JetBrains Mono (labels),
          Newsreader (story body).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&display=swap');

/* ---- Design tokens -------------------------------------- */
:root {
  --accent: #1e3a8a;         /* single themeable accent (dark blue) */

  --bg: #08090c;
  --bg-tint: #10131b;

  --panel-a: #0f1116;
  --panel-b: #0b0c10;
  --panel-c: #0a0b0f;
  --input-bg: #0b0c11;

  --stripe: repeating-linear-gradient(135deg, #0d0f14 0 14px, #0b0c11 14px 28px);

  --line: #1c1f27;
  --line-2: #23262e;
  --line-hover: #3a3e48;

  --text: #e9ebf0;
  --text-2: #cfd2da;
  --text-3: #b6bac4;
  --text-4: #a9adb8;
  --muted: #8b8f9a;
  --muted-2: #7d818c;
  --muted-3: #6a6f7c;
  --faint: #575b66;
  --error: #ff6b6b;

  --h-pad: clamp(24px, 6vw, 80px);
  --max-w: 1200px;

  --mono: 'JetBrains Mono', monospace;
  --serif: 'Newsreader', serif;
}

/* ---- Reset ---------------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

/* Page background radial tint */
.page-bg {
  background: radial-gradient(ellipse 100% 70% at 50% -10%, var(--bg-tint) 0%, var(--bg) 55%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ---- Decorative background layers ----------------------- */
.tri-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.grid-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.grid-layer[hidden] { display: none; }

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(3%, -4%) scale(1.08); }
}
@keyframes floatGlow2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-4%, 3%) scale(1.12); }
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.glow--a {
  top: 8%; right: -6%;
  width: 46vw; height: 46vw; max-width: 640px; max-height: 640px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 62%);
  opacity: 0.5; filter: blur(30px);
  animation: floatGlow 14s ease-in-out infinite;
}
.glow--b {
  bottom: 4%; left: -8%;
  width: 34vw; height: 34vw; max-width: 460px; max-height: 460px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 60%);
  opacity: 0.28; filter: blur(40px);
  animation: floatGlow2 18s ease-in-out infinite;
}

/* ---- Nav ------------------------------------------------ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--h-pad);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(8,9,12,0.85), rgba(8,9,12,0));
}
.logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo__mark {
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  font-family: var(--mono);
  font-size: 13px;
  color: #9599a4;
}
.nav__links a { transition: color .2s, opacity .2s; }
.nav__links a:not(.nav__photos):hover { color: var(--text); }
.nav__photos {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}
.nav__photos:hover { opacity: 0.75; }
.nav__photos span { font-size: 12px; }
.nav__back {
  font-family: var(--mono);
  font-size: 13px;
  color: #9599a4;
  transition: color .2s;
}
.nav__back:hover { color: var(--text); }

/* ---- Layout helpers ------------------------------------- */
.section {
  position: relative;
  z-index: 1;
  padding: 90px var(--h-pad);
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 44px;
}
.section-head h2 {
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hairline {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}
.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  color: var(--accent);
}

/* ---- Hero ----------------------------------------------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 104px var(--h-pad) 48px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero > :not(.glow) { position: relative; z-index: 1; }
.hero__eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}
.hero h1 {
  margin-top: 20px;
  font-size: clamp(52px, 12vw, 152px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
}
.hero h1 .muted { color: var(--muted-3); }
.hero__intro {
  margin-top: 28px;
  max-width: 520px;
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.55;
  color: var(--text-3);
}
.hero__cta {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
}

/* ---- Buttons -------------------------------------------- */
.btn {
  font-family: var(--mono);
  cursor: pointer;
  border-radius: 10px;
  display: inline-block;
}
.btn--primary {
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  border: none;
  transition: transform .18s, box-shadow .18s;
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent);
}
.btn--ghost {
  padding: 13px 22px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  background: transparent;
  transition: border-color .18s, background .18s;
}
.btn--ghost:hover {
  border-color: var(--line-hover);
  background: rgba(255,255,255,0.03);
}

/* ---- Games ---------------------------------------------- */
.game-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--panel-a), var(--panel-b));
  transition: transform .22s, border-color .22s, box-shadow .22s;
  margin-bottom: 24px;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 24px 60px -20px var(--accent);
}
.game-card__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 340px;
}
.game-card__body {
  padding: clamp(24px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.game-card__tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted-3);
  text-transform: uppercase;
}
.game-card__title {
  margin-top: 14px;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.game-card__desc {
  margin-top: 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-4);
  max-width: 40ch;
}
.game-card__meta {
  margin-top: 28px;
  display: flex;
  gap: 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
}
.game-card__meta .status { color: var(--accent); }

.placeholder {
  position: relative;
  background: var(--stripe);
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-card__art {
  border-left: 1px solid var(--line);
}
.placeholder span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0 20px;
}
.note {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted-3);
  margin-top: 4px;
}

/* ---- Story ---------------------------------------------- */
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.story__eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.story h3 {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.story__excerpt {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.7;
  color: var(--text-2);
  max-width: 46ch;
}
.story__stop {
  margin-top: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 46ch;
}
.pill {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
  padding: 11px 18px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.pill__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.4s step-end infinite;
}
.book {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--stripe);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.8);
}
.book span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
  text-align: center;
}

/* ---- Contact -------------------------------------------- */
.contact { padding-bottom: 60px; }
.contact__panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(36px, 6vw, 72px);
  background: linear-gradient(160deg, var(--panel-a), var(--panel-c));
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact__glow {
  position: absolute;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: 60%; height: 200px;
  background: radial-gradient(ellipse, var(--accent) 0%, transparent 70%);
  opacity: 0.35;
  filter: blur(30px);
  pointer-events: none;
}
.contact__panel > :not(.contact__glow) { position: relative; }
.contact__eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 14px;
}
.contact h2 {
  margin-top: 16px;
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.contact__sub {
  margin-top: 18px;
  font-size: 17px;
  color: var(--text-4);
  max-width: 46ch;
  margin-left: auto;
  margin-right: auto;
}

.form {
  margin: 36px auto 0;
  max-width: 560px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field > span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
}
.field .optional { opacity: 0.6; }
.field input,
.field textarea {
  background: var(--input-bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 13px 15px;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color .18s;
}
.field textarea {
  line-height: 1.5;
  resize: vertical;
}
.field input:focus,
.field textarea:focus { border-color: var(--accent); }

.form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.form__status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-3);
}
.form__status.is-error { color: var(--error); }
.form__status.is-sending { color: var(--text-4); }
.btn--send {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 13px 26px;
  transition: transform .18s, box-shadow .18s;
}
.btn--send:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px var(--accent);
}
.btn--send:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.contact__sent {
  margin: 40px auto 8px;
  max-width: 520px;
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 40px 28px;
  background: rgba(255,255,255,0.02);
}
.contact__sent .check { font-size: 34px; }
.contact__sent h3 {
  margin-top: 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.contact__sent p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-4);
}
.btn--again {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-2);
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: border-color .18s;
}
.btn--again:hover { border-color: var(--line-hover); }

.chips {
  margin-top: 40px;
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--mono);
  font-size: 14px;
}
.chip {
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.02);
}
.chip .k { color: var(--muted-3); }
.footer {
  text-align: center;
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* ---- Photos page ---------------------------------------- */
.photos-section {
  min-height: 100vh;
  padding: 120px var(--h-pad) 80px;
  max-width: 1100px;
  margin: 0 auto;
}
.gate {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.gate__lock {
  width: 64px; height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(255,255,255,0.02);
}
.gate h1 {
  margin-top: 24px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.gate p {
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-4);
  max-width: 40ch;
}
.gate__form {
  margin-top: 30px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.gate__form input {
  background: var(--input-bg);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.08em;
  outline: none;
  text-align: center;
  transition: border-color .18s;
}
.gate__form input:focus { border-color: var(--accent); }
.gate__form input.is-error { border-color: var(--error); }
.gate__unlock {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform .18s;
}
.gate__unlock:hover { transform: translateY(-2px); }
.gate__error {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--error);
  min-height: 18px;
}
.photos-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}
.photos-head h1 {
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.photos-note {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted-3);
  margin-bottom: 34px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.4vw, 14px);
}
.photo-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--stripe);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.08em;
}

[hidden] { display: none !important; }

/* ---- Responsive ----------------------------------------- */
@media (max-width: 760px) {
  .game-card__inner { grid-template-columns: 1fr; }
  .game-card__art { border-left: none; border-top: 1px solid var(--line); min-height: 220px; }
  .story-grid { grid-template-columns: 1fr; }
  .story .book { max-width: 320px; }
  .form__row { grid-template-columns: 1fr; }
  .nav__links { gap: 16px; }
}
@media (max-width: 460px) {
  .nav__links a[href="#games"],
  .nav__links a[href="#story"] { display: none; }
}
