:root {
  --bg: #070a12;
  --surface: #101726;
  --surface-2: #1b2740;
  --text: #f7f9ff;
  --muted: #a2acc3;
  --accent: #8592ff;
  --accent-2: #67d6ff;
  --border: rgba(255, 255, 255, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(900px 420px at 82% -10%, rgba(120, 130, 255, 0.22), transparent 65%),
    radial-gradient(760px 360px at 5% 15%, rgba(103, 214, 255, 0.13), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

body.loading {
  overflow: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-content: center;
  gap: 0.9rem;
  background:
    radial-gradient(700px 320px at 75% -20%, rgba(120, 130, 255, 0.2), transparent 68%),
    radial-gradient(580px 280px at 10% 20%, rgba(103, 214, 255, 0.16), transparent 65%),
    #060912;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-cat {
  width: 112px;
  height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(103, 214, 255, 0.35)) drop-shadow(0 14px 28px rgba(0, 0, 0, 0.42));
  animation: spinLoader 0.92s linear infinite;
}

.loader-text {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

.cat-walker {
  position: fixed;
  left: 0;
  bottom: 12px;
  z-index: 18;
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  animation: catWalk 18s linear infinite;
}

.cat-walker img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
  animation: catStep 0.5s ease-in-out infinite;
}

@keyframes catWalk {
  0% {
    transform: translateX(-70px);
  }
  49% {
    transform: translateX(calc(100vw - 8px));
  }
  50% {
    transform: translateX(calc(100vw - 8px));
  }
  100% {
    transform: translateX(-70px);
  }
}

@keyframes catStep {
  0%,
  49% {
    transform: translateY(0) scaleX(1);
  }
  25% {
    transform: translateY(-3px) scaleX(1);
  }
  50%,
  100% {
    transform: translateY(0) scaleX(-1);
  }
  75% {
    transform: translateY(-3px) scaleX(-1);
  }
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  pointer-events: none;
}

.bg-glow-1 {
  width: 320px;
  height: 320px;
  background: rgba(126, 141, 255, 0.24);
  top: -80px;
  right: -80px;
}

.bg-glow-2 {
  width: 280px;
  height: 280px;
  background: rgba(86, 212, 255, 0.15);
  bottom: 15%;
  left: -80px;
}

.site-header,
.section,
.site-footer {
  width: min(1080px, 92vw);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0.7rem;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(16, 23, 38, 0.62);
  backdrop-filter: blur(12px);
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 1rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.25s ease;
}

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

.section {
  padding: 3rem 0 1.2rem;
}

.hero {
  padding-top: 4.5rem;
}

.hero-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.4rem;
  align-items: center;
  max-width: 920px;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.profile-pic {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-2);
  box-shadow: 0 0 0 7px rgba(103, 214, 255, 0.12), 0 22px 45px rgba(0, 0, 0, 0.38);
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
  margin: 0 0 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 3.6rem);
  line-height: 1.25;
  padding-bottom: 0.1em;
  letter-spacing: -0.02em;
  background: linear-gradient(98deg, #ffffff 18%, #dce4ff 45%, #b8f3ff 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  margin-top: 1rem;
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 65ch;
  line-height: 1.65;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--border);
  transition: transform 0.22s ease, background-color 0.22s ease, color 0.22s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0a0c12;
  border: none;
}

.btn-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  margin-top: 1.3rem;
}

.card {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.05rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(103, 214, 255, 0.42);
  box-shadow: 0 22px 35px rgba(4, 8, 18, 0.52);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.card-top a {
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0.9rem 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tags span,
.latest {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.73rem;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.03);
}

.latest {
  margin-left: 0.45rem;
  color: #101420;
  border: none;
  background: linear-gradient(90deg, #aeb7ff, #9df2ff);
}

.media-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.media-card {
  margin: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.01));
  border-radius: 18px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease;
}

.media-card:hover {
  transform: translateY(-4px);
  border-color: rgba(133, 146, 255, 0.46);
  box-shadow: 0 18px 30px rgba(4, 8, 18, 0.5);
}

.media-card img,
.media-card video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 0.35s ease;
}

.media-card:hover img,
.media-card:hover video {
  transform: scale(1.05);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .loader-cat,
  .cat-walker,
  .cat-walker img {
    animation: none;
  }
}

.site-footer {
  padding: 2rem 0 2.4rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .site-header {
    top: 0.35rem;
  }

  .project-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3.1rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-visual {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .cat-walker {
    bottom: 8px;
  }

  .cat-walker img {
    width: 64px;
    height: 64px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .site-nav {
    gap: 0.8rem;
    flex-wrap: wrap;
  }

  .card-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* skjson Toolkit & Premium UI Styles */

@keyframes vibrantGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient {
  background: linear-gradient(135deg, rgba(133, 146, 255, 0.4), rgba(103, 214, 255, 0.3), rgba(255, 117, 140, 0.2));
  background-size: 300% 300%;
  animation: vibrantGradient 10s ease infinite;
}

.bg-glow-3 {
  width: 400px;
  height: 400px;
  top: 30%;
  left: 30%;
  opacity: 0.6;
  filter: blur(90px);
}

.glass-panel {
  background: rgba(16, 23, 38, 0.3);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.premium-card {
  position: relative;
  overflow: hidden;
  background: rgba(16, 23, 38, 0.3);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding: 1.5rem;
  border-radius: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.premium-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-20deg);
  transition: all 0.7s ease;
}

.premium-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.premium-card:hover::after {
  left: 200%;
}

.premium-glow {
  position: relative;
}

.premium-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #8592ff, #67d6ff, #ff7eb3);
  background-size: 300% 300%;
  animation: vibrantGradient 6s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.premium-glow:hover::before {
  opacity: 1;
}

.animated-text {
  background: linear-gradient(90deg, #8592ff, #67d6ff, #ff7eb3, #8592ff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: vibrantGradient 6s ease infinite;
}

.glass-input {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px);
  color: var(--text) !important;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease !important;
}

.glass-input:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(103, 214, 255, 0.5) !important;
  box-shadow: 0 0 15px rgba(103, 214, 255, 0.2), inset 0 2px 4px rgba(0,0,0,0.2) !important;
  outline: none;
}

.premium-btn {
  background: linear-gradient(135deg, #8592ff, #67d6ff) !important;
  color: #000 !important;
  border: none !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(103, 214, 255, 0.3);
  z-index: 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.premium-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #67d6ff, #ff7eb3);
  z-index: -1;
  transition: opacity 0.4s ease;
  opacity: 0;
}

.premium-btn:hover::before {
  opacity: 1;
}

.premium-btn:hover {
  box-shadow: 0 6px 20px rgba(255, 126, 179, 0.4);
  transform: translateY(-2px);
}

.toolkit-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 2.5rem;
  border-radius: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.toolkit-banner-content h3 {
  margin: 0 0 0.8rem 0;
  font-size: 1.6rem;
}

.toolkit-banner-content p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 55ch;
  line-height: 1.6;
}

.toolkit-intro {
  max-width: 800px;
}

.toolkit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.code-block {
  display: block;
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem;
  color: #aeb7ff;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.active-nav {
  color: var(--text) !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Chatbot UI */
.chat-container {
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 1.5rem;
}

.api-key-setup {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.api-key-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.api-key-info svg {
  color: var(--accent-2);
  min-width: 20px;
}

.api-key-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.api-key-inputs input {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-family: monospace;
  width: 200px;
}

.api-key-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.chat-interface {
  display: flex;
  flex-direction: column;
  height: 500px;
  opacity: 0.3;
  pointer-events: none;
  filter: blur(4px);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(10px);
}

.chat-interface.chat-ready {
  opacity: 1;
  pointer-events: auto;
  filter: blur(0);
  transform: translateY(0);
}

.chat-interface.chat-initializing {
  animation: bootSequence 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bootSequence {
  0% { opacity: 0.3; filter: blur(4px); transform: scale(0.98); }
  50% { opacity: 0.8; filter: blur(2px) hue-rotate(90deg); transform: scale(1.02); }
  100% { opacity: 1; filter: blur(0); transform: scale(1); pointer-events: auto; }
}

.chat-log {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  display: flex;
  max-width: 80%;
  animation: messageSlideIn 0.3s ease-out forwards;
}

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

.chat-message.user {
  align-self: flex-end;
}

.chat-message.model, .chat-message.system {
  align-self: flex-start;
}

.message-content {
  padding: 0.8rem 1.2rem;
  border-radius: 18px;
  line-height: 1.5;
  font-size: 0.95rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.chat-message.user .message-content {
  background: linear-gradient(135deg, var(--accent), #6b7dff);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-message.model .message-content {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-message.system .message-content {
  background: rgba(255, 107, 107, 0.1);
  color: #ff8e8e;
  border: 1px solid rgba(255, 107, 107, 0.2);
  font-size: 0.85rem;
  border-bottom-left-radius: 4px;
}

.message-content pre {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.75rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.message-content code {
  font-family: monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.message-content p {
  margin: 0;
}

.message-content p + p {
  margin-top: 0.5rem;
}

.typing-indicator {
  display: flex;
  gap: 6px;
  padding: 0.4rem 0.2rem;
  align-items: center;
  justify-content: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.chat-input-area {
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.chat-input-area textarea {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-family: inherit;
  resize: none;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-input-area button {
  padding: 0 1.5rem;
  height: 48px;
  border-radius: 12px;
}

@media (max-width: 600px) {
  .toolkit-banner {
    padding: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .glass-panel {
    padding: 1rem;
  }
  .premium-card {
    padding: 1.2rem;
  }
  .api-key-setup {
    flex-direction: column;
    align-items: stretch;
  }
  .api-key-inputs {
    flex-direction: column;
    align-items: stretch;
  }
  .api-key-inputs input {
    width: 100%;
  }
  .chat-message {
    max-width: 95%;
  }
  .message-content {
    padding: 0.6rem 0.9rem;
  }
}

