/* Kaalin Mobtech LLP — portfolio site
   A deliberately single-theme "arcade at night" world: the palette below
   is painted explicitly rather than adapting to light/dark, the way a
   neon cabinet screen looks the same regardless of the room around it. */

:root {
  --ink: #0d1017;
  --ink-raised: #171c27;
  --ink-raised-2: #1e2530;
  --line: #2a3140;
  --marquee: #f2a93b;
  --marquee-ink: #241705;
  --cathode: #47c9d6;
  --paper: #ede9e2;
  --haze: #9aa1b4;
  --haze-dim: #6b7387;
  --marquee-tint: rgba(242, 169, 59, 0.16);
  --cathode-tint: rgba(71, 201, 214, 0.16);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --fs-hero: clamp(2.5rem, 1.7rem + 3.2vw, 4.25rem);
  --fs-h2: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);
  --fs-h3: 1.25rem;

  --container: 1120px;
  --gutter: 24px;
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

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

html {
  background: var(--ink);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-inline: var(--gutter);
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--paper);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

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

img { max-width: 100%; }

.wrap {
  max-width: var(--container);
  margin-inline: auto;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cathode);
  margin: 0 0 14px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--marquee);
  color: var(--marquee-ink);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -10px rgba(242, 169, 59, 0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: var(--line);
}

.btn-ghost:hover {
  border-color: var(--cathode);
  color: var(--cathode);
}

.btn-small {
  padding: 9px 18px;
  font-size: 0.875rem;
}

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

/* Header */

.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(13, 16, 23, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--marquee);
  color: var(--marquee-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.logo-suffix {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--haze-dim);
}

.site-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--haze);
}

.site-nav a:hover { color: var(--paper); }

.header-inner .btn-small { margin-inline-start: auto; }

@media (max-width: 700px) {
  .header-inner { justify-content: flex-start; }
  /* The primary CTA already appears in the hero just below, so the header
     doesn't need to repeat it on small screens — one less thing competing
     for attention before the page even starts. */
  .header-inner .btn-small { display: none; }
  .site-nav { order: 2; }
}

/* Sections */

main section {
  padding-block: clamp(56px, 6vw + 24px, 108px);
}

.section-head {
  max-width: 620px;
  margin-bottom: 44px;
}

.section-lede {
  margin-top: 14px;
  color: var(--haze);
  font-size: 1.05rem;
}

/* Hero */

.hero {
  padding-top: clamp(64px, 8vw, 120px);
  background:
    radial-gradient(circle at 1px 1px, rgba(237, 233, 226, 0.06) 1px, transparent 0) 0 0 / 28px 28px,
    var(--ink);
}

.hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.hero-copy { flex: 1 1 480px; }

h1 {
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero-lede {
  margin-top: 22px;
  max-width: 46ch;
  font-size: 1.15rem;
  color: var(--haze);
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.hero-tiles {
  position: relative;
  flex: 0 0 auto;
  width: min(320px, 80vw);
  aspect-ratio: 1;
  margin-inline: auto;
}

.tile {
  position: absolute;
  border-radius: var(--radius-md);
  background: var(--ink-raised);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-a {
  width: 46%;
  height: 46%;
  top: 4%;
  left: 8%;
  background: var(--marquee);
  border-color: transparent;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(242, 169, 59, 0.45);
  rotate: -6deg;
}

.tile-play {
  font-size: clamp(1.2rem, 6vw + 0.4rem, 2rem);
  color: var(--marquee-ink);
  opacity: 0.55;
}

.tile-b {
  width: 34%;
  height: 34%;
  top: 6%;
  right: 4%;
  rotate: 8deg;
}

.tile-c {
  width: 30%;
  height: 30%;
  bottom: 6%;
  right: 14%;
  background: var(--ink-raised-2);
  border-color: var(--cathode);
  rotate: -4deg;
}

.tile-d {
  width: 22%;
  height: 22%;
  bottom: 4%;
  left: 6%;
  rotate: 12deg;
}

.tile-e {
  width: 16%;
  height: 16%;
  top: 40%;
  left: 42%;
  border-radius: 999px;
  background: var(--ink);
  border-color: var(--line);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise 0.6s ease both;
  }
  .hero-copy .eyebrow { animation-delay: 0s; }
  .hero-copy h1 { animation-delay: 0.06s; }
  .hero-copy .hero-lede { animation-delay: 0.12s; }
  .hero-copy .hero-actions { animation-delay: 0.18s; }

  /* A slow, gentle bob per tile — an arcade marquee that idles instead of
     sitting dead still. Durations/delays are staggered so the tiles never
     move in lockstep. */
  .tile { animation: float 5s ease-in-out infinite; }
  .tile-a { animation-duration: 6s; }
  .tile-b { animation-delay: -1.2s; animation-duration: 4.5s; }
  .tile-c { animation-delay: -2.4s; animation-duration: 5.5s; }
  .tile-d { animation-delay: -3.6s; animation-duration: 4s; }
  .tile-e { animation-delay: -0.8s; animation-duration: 5s; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

/* About */

.about-inner {
  display: flex;
  gap: clamp(32px, 5vw, 80px);
  align-items: flex-start;
  flex-wrap: wrap;
}

.about-copy {
  flex: 1 1 420px;
}

.about-copy h2 { font-size: var(--fs-h2); }

.about-copy p { margin-top: 18px; color: var(--haze); font-size: 1.05rem; max-width: 60ch; }

.fact-panel {
  flex: 0 1 320px;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0;
}

.fact {
  background: var(--ink-raised);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
}

.fact dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--haze-dim);
}

.fact dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

/* Games */

.game-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 20px;
}

.game-card {
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease, opacity 0.6s ease;
}

.game-card:hover {
  border-color: var(--marquee);
  transform: translateY(-3px);
}

.game-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.game-index {
  font-family: var(--font-mono);
  color: var(--haze-dim);
  font-size: 0.875rem;
}

.status {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.status-dev { color: var(--marquee); }
.status-concept { color: var(--cathode); }
.status-proto { color: var(--haze); }

.game-card h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
}

.game-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--ink-raised-2);
  border: 1px solid var(--line);
}

/* Cycle the two accent colors across cards (plus a neutral third) so the
   grid doesn't read as one flat block of identical cards. */
.game-card:nth-of-type(3n+1) .game-icon { background: var(--marquee-tint); border-color: var(--marquee); }
.game-card:nth-of-type(3n+2) .game-icon { background: var(--cathode-tint); border-color: var(--cathode); }

.game-genre {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--haze-dim);
}

.game-pitch {
  color: var(--haze);
  font-size: 0.95rem;
  flex-grow: 1;
}

.game-platforms {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--haze-dim);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Services */

.service-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.service-card {
  background: var(--ink);
  padding: 28px 24px;
}

.service-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.service-card p {
  color: var(--haze);
  font-size: 0.95rem;
}

/* Contact */

.contact-inner {
  display: flex;
  gap: clamp(32px, 5vw, 80px);
  flex-wrap: wrap;
  align-items: flex-start;
}

.contact-copy {
  flex: 1 1 380px;
}

.contact-copy h2 { font-size: var(--fs-h2); }

.contact-copy p {
  margin-top: 16px;
  color: var(--haze);
  font-size: 1.05rem;
  max-width: 46ch;
}

.contact-copy .btn { margin-top: 28px; }

.contact-panel {
  flex: 1 1 380px;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 26px;
  margin: 0;
}

.contact-row {
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.contact-row:last-child { border-bottom: none; }

.contact-row dt {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--haze-dim);
  margin-bottom: 6px;
}

.contact-row dd {
  margin: 0;
  font-weight: 500;
  line-height: 1.5;
}

.placeholder {
  color: var(--haze-dim);
  font-style: italic;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: env(safe-area-inset-bottom, 0px) 0;
}

.footer-inner {
  padding-block: 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--haze-dim);
  font-size: 0.875rem;
}

.footer-tag {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

/* Focus */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cathode);
  outline-offset: 2px;
}

/* Scroll reveal — classes are added by script.js via IntersectionObserver,
   so with JS disabled (or motion reduced) elements simply stay visible. */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* .game-card already owns a `transition` shorthand for its hover state,
     so its reveal only fades in (no transform) — sharing that property
     across two separate rules would let one silently override the other. */
  .reveal-fade { opacity: 0; }
  .reveal-fade.is-visible { opacity: 1; }
}
