/* HappyHouse — Digital Workshop + Personal Lab */
:root {
  --bg: #0c0e12;
  --bg-elevated: #141820;
  --bg-card: #12161d;
  --border: #252b36;
  --border-hover: #3d4656;
  --text: #ebe8e2;
  --text-muted: #8a909b;
  --accent: #e4a93a;
  --accent-soft: rgba(228, 169, 58, 0.16);
  --focus: #e4a93a;
  --radius: 6px;
  --max: 1100px;
  --header-h: 64px;
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --ease: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(228, 169, 58, 0.06), transparent 55%),
    var(--bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: #f0c15a;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #1a1408;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: rgba(12, 14, 18, 0.92);
  backdrop-filter: blur(8px);
}

.site-header__inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.site-footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

/* Hero — compact, works-first */
.hero {
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.hero__brand {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--text);
}

.hero__tagline {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  max-width: 22ch;
}

.hero__support {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 36ch;
}

/* Filters */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

.filter-btn.is-active,
.filter-btn[aria-pressed="true"] {
  color: #1a1408;
  background: var(--accent);
  border-color: var(--accent);
}

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--ease);
}

.project-card:hover,
.project-card:focus-visible {
  border-color: var(--accent);
}

.project-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.project-card:hover .project-card__media img,
.project-card:focus-visible .project-card__media img {
  transform: scale(1.035);
}

@media (prefers-reduced-motion: reduce) {
  .project-card:hover .project-card__media img,
  .project-card:focus-visible .project-card__media img {
    transform: none;
  }
}

.project-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1rem 1.1rem;
  flex: 1;
}

.project-card__meta {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.project-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text);
}

.project-card__desc {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.project-card__arrow {
  margin-top: 0.75rem;
  align-self: flex-start;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform var(--ease);
}

.project-card:hover .project-card__arrow,
.project-card:focus-visible .project-card__arrow {
  transform: translateX(4px);
}

.project-card.is-hidden,
.project-card[hidden] {
  display: none !important;
}

.empty-filter {
  display: none;
  grid-column: 1 / -1;
  padding: 2rem 0;
  color: var(--text-muted);
  text-align: center;
}

.empty-filter.is-visible {
  display: block;
}

/* Work detail */
.work-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.work-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
}

.work-tagline {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 42ch;
}

.work-hero {
  margin: 0 0 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}

.work-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.work-section {
  margin-bottom: 2.5rem;
}

.work-section h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.work-section p {
  margin: 0 0 1rem;
  color: var(--text);
  max-width: 60ch;
}

.work-section p:last-child {
  margin-bottom: 0;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .screenshot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.screenshot-grid li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
  aspect-ratio: 16 / 10;
}

.screenshot-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tech-list li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.link-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.link-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.link-list a.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1408;
  font-weight: 600;
}

.link-list a.is-primary:hover {
  background: #f0c15a;
  color: #1a1408;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--accent);
}

/* About / Privacy */
.page-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 700;
}

.prose {
  max-width: 54ch;
  color: var(--text-muted);
}

.prose p {
  margin: 0 0 1rem;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.privacy-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.privacy-list a {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
}

.privacy-list a:hover {
  border-color: var(--accent);
}

/* Privacy policy pages */
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: inherit;
  padding: 0.2rem 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: transparent;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button.is-active {
  color: var(--accent);
  text-decoration-color: var(--accent);
  font-weight: 600;
}

.lang-switch__sep {
  color: var(--border-hover);
  user-select: none;
}

.policy-doc {
  max-width: 62ch;
}

.policy-doc[hidden] {
  display: none !important;
}

.policy-doc .page-title {
  margin-bottom: 0.35rem;
}

.policy-effective {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.policy-doc h2 {
  margin: 2rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}

.policy-doc .prose {
  max-width: none;
}

.policy-doc .prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.policy-doc .prose li {
  margin: 0.35rem 0;
}

/* Game embed shell */
.game-shell {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.game-shell__frame {
  flex: 1;
  min-height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #000;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.game-shell__frame p {
  margin: 0.35rem 0;
}

/* 404 */
.error-page {
  text-align: center;
  padding: 4rem 1rem;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 0.75rem;
}

.error-page p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}
