/* ============================================================
   neokex — portfolio
   Layout and tokens matched to orang.ci (Rose Pine / Lexend)
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root,
html[data-theme="dark"] {
  --base-100: #191724;   /* page background */
  --base-200: #1f1d2e;   /* raised surface  */
  --base-300: #26233a;   /* borders         */
  --content: #e0def4;    /* body text       */
  --primary: #ebbcba;    /* rose            */
  --accent: #f6c177;     /* gold            */
  --neutral: #9ccfd8;    /* foam            */
  --secondary: #31748f;  /* pine            */
  --info: #c4a7e7;       /* iris            */
  --error: #eb6f92;      /* love            */
  --theme-label: "Rose Pine";
}

html[data-theme="light"] {
  --base-100: #faf4ed;
  --base-200: #fffaf3;
  --base-300: #f2e9e1;
  --content: #575279;
  --primary: #d7827e;
  --accent: #ea9d34;
  --neutral: #286983;
  --secondary: #56949f;
  --info: #907aa9;
  --error: #b4637a;
  --theme-label: "Rose Pine Dawn";
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--base-100);
  color: var(--content);
  font-family: "Lexend", sans-serif;
  font-size: 18px;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.2; }
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--info); }

.icon {
  width: 1em; height: 1em; flex-shrink: 0;
  display: inline-block; vertical-align: -0.125em;
}

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

/* Visible to assistive tech and crawlers, not on screen. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--base-200); padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Shell ---------- */
.shell {
  display: flex; flex-direction: column;
  max-width: 1152px; min-height: 100dvh;
  margin: 0 auto; padding: 12px;
}
.grow { flex-grow: 1; }

/* ---------- Nav ---------- */
.nav {
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: center;
  gap: 8px; max-width: 1280px;
  margin: 0 auto; padding: 8px 16px;
}

.tabs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 33.25px; padding: 0 16px; border-radius: 16px;
  font-size: 16px; color: var(--neutral);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.pill .icon { font-size: 20px; }
.pill:hover { color: var(--primary); background: color-mix(in oklab, var(--primary) 20%, transparent); }
.pill[aria-current="page"] { color: #fff; background: var(--primary); }

/* Tighter pills below 640px so the three tabs fit one row on phones. */
@media (max-width: 640px) {
  .nav { padding: 8px 10px; }
  .tabs { gap: 4px; }
  .pill { height: 32px; padding: 0 11px; gap: 6px; font-size: 15px; }
  .pill .icon { font-size: 18px; }
}
@media (max-width: 360px) {
  .tabs { gap: 3px; }
  .pill { padding: 0 9px; gap: 5px; font-size: 14px; }
  .pill .icon { font-size: 16px; }
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: space-between;
  width: 144px; height: 33.25px; padding: 0 12px 0 12px;
  border-radius: 16px;
  background: var(--base-100); color: var(--content);
  border: 1px solid color-mix(in oklab, var(--content) 40%, transparent);
  font: inherit; font-size: 16px; cursor: pointer;
  transition: border-color 0.15s ease;
}
.theme-toggle:hover { border-color: var(--primary); }
.theme-toggle .icon { font-size: 16px; color: color-mix(in oklab, var(--content) 55%, transparent); }
/* Phones get a compact icon-only toggle so the feature is not lost. */
@media (max-width: 767px) {
  .theme-toggle { width: 32px; height: 32px; padding: 0; justify-content: center; }
  .theme-toggle .theme-label, .theme-toggle .icon { display: none; }
  .theme-toggle::before {
    content: "";
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--accent);
    box-shadow: inset -5px -2px 0 0 var(--base-100);
  }
}

/* ---------- Hero ---------- */
.hero {
  display: flex; align-items: center; justify-content: center;
  margin-top: 15vh; padding: 20px 0;
}
@media (min-width: 768px) { .hero { margin-top: 35vh; } }

.avatar {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; margin-right: 24px;
}
.hero-name {
  display: inline-block; margin: 0 8px 0 0;
  color: var(--accent); font-size: 36px; line-height: 2.5rem;
}
.tagline {
  margin: 0 0 8px; font-style: italic; font-size: 18px; line-height: 1.75rem;
  color: color-mix(in oklab, var(--content) 70%, transparent);
}

.socials { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.social {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 40px; height: 40px;
  color: var(--brand, var(--content));
  transition: color 0.15s ease;
}
.social .icon { width: 38px; height: 38px; transition: transform 0.15s ease; }
.social:hover .icon { transform: scale(1.12); }

/* Official brand colours, shown at rest so every logo is recognisable.
   GitHub, Steam and Backloggd ship as near-black marks, which would
   disappear on the dark background, so those keep the theme's ink and
   only take their true colour on the light theme. Declared once and
   reused by the hero row and the contact list. */
.social--mail,     .contact--mail     { --brand: var(--accent); }
.social--github,   .contact--github   { --brand: #e0def4; }
.social--steam,    .contact--steam    { --brand: #66c0f4; }
.social--backloggd,.contact--backloggd{ --brand: #fa7c4e; }
.social--youtube,  .contact--youtube  { --brand: #ff0000; }
.social--instagram,.contact--instagram{ --brand: #ff0069; }
.social--facebook, .contact--facebook { --brand: #0866ff; }
.social--upwork,   .contact--upwork   { --brand: #6fda44; }

html[data-theme="light"] .social--github,
html[data-theme="light"] .contact--github { --brand: #181717; }

@media (max-width: 640px) {
  .hero { flex-direction: column; text-align: center; margin-top: 6vh; }
  .avatar { margin: 0 0 16px; }
  .socials { justify-content: center; gap: 2px; }
  /* Eight icons have to share one row; shrink them slightly so the row
     never wraps into a stray single icon. */
  .social { width: 40px; height: 40px; }
  .social .icon { width: 36px; height: 36px; }
}
@media (max-width: 374px) {
  .social { width: 36px; height: 36px; }
  .social .icon { width: 32px; height: 32px; }
}
@media (max-width: 330px) {
  .socials { gap: 0; }
  .social { width: 32px; height: 32px; }
  .social .icon { width: 28px; height: 28px; }
}
@media (max-width: 290px) {
  .social { width: 28px; height: 28px; }
  .social .icon { width: 24px; height: 24px; }
}

/* ---------- Pages / sections ---------- */
.page { padding: 34px 0; }
.page h1, .page h2 { color: var(--accent); font-size: 30px; margin-bottom: 14px; letter-spacing: -0.01em; }
.page p { font-size: 19px; max-width: 62ch; }
.page a { color: var(--info); }
.page a:hover { text-decoration: underline; }
.accent { color: var(--accent); }
.lede { color: color-mix(in oklab, var(--content) 70%, transparent); font-size: 17px; }

/* ---------- Skills ---------- */
.skill-groups { display: grid; gap: 18px; }
.skill-groups h3 {
  font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--neutral); margin-bottom: 4px;
}
.skill-line { font-size: 18px; margin: 0; }

/* ---------- Projects ---------- */
.project-list { list-style: none; margin: 0; padding: 0; }
.project-list li { position: relative; padding: 4px 0 4px 22px; font-size: 18px; }
.project-list li::before {
  content: ""; position: absolute; left: 2px; top: 0.85em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.project-list a { color: var(--content); display: inline; }
.project-list a:hover { color: var(--accent); }
.project-meta {
  display: block; font-size: 14px;
  color: color-mix(in oklab, var(--content) 60%, transparent);
}
.project-arrow {
  display: inline-block; margin-left: 4px; width: 20px; height: 20px;
  vertical-align: -4px;
  color: color-mix(in oklab, var(--content) 55%, transparent);
  transition: color 0.15s ease, transform 0.15s ease;
}
.project-list a:hover .project-arrow { color: var(--accent); transform: translateX(3px); }
.loading { color: color-mix(in oklab, var(--content) 65%, transparent); }

/* ---------- Contact ---------- */
.contact-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 4px; }
.contact-list a { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; color: var(--content); }
.contact-list .icon { font-size: 20px; color: var(--brand, var(--neutral)); }
.contact-list a:hover { color: var(--accent); }
.contact-list a:hover .icon { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  text-align: center; margin: 40px 0 0;
  padding: 8px 0 20px;
  font-size: 18px; line-height: 1.5;
  color: var(--content);
}
.footer p { margin: 0; }

.footer a { color: var(--neutral); }
.footer a:hover { color: var(--primary); }

.soft-pill {
  display: inline-flex; align-items: center;
  padding: 8px; border-radius: 16px;
  background: color-mix(in oklab, var(--neutral) 12%, var(--base-100));
  color: var(--neutral);
  font-size: 16px; line-height: 1.4;
}

@media (max-width: 640px) {
  .footer { font-size: 15px; }
  .soft-pill { font-size: 14px; padding: 6px 10px; }
}

/* ---------- Oneko (cursor-chasing cat) ---------- */
#oneko {
  pointer-events: none;
  image-rendering: pixelated;
  will-change: left, top;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.28));
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
