/* ============================================================
   IKRAM'S WORLD — base stylesheet
   Style is intentionally neutral. Re-theme by changing the
   variables in :root below.
   ============================================================ */

:root {
  /* Color palette — change these to re-theme everything */
  --bg:        #0e0f13;
  --surface:   #181a21;
  --surface-2: #20232d;
  --text:      #e9eaf0;
  --muted:     #99a0b0;
  --accent:    #5b8cff;
  --accent-2:  #8a5bff;
  --border:    #2a2e3a;
  --good:      #4ad991;

  /* Type + spacing */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --maxw: 1080px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Top navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,15,19,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-nav .nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 20px; max-width: var(--maxw); margin: 0 auto;
}
.brand {
  font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); font-size: 0.95rem; white-space: nowrap;
}
.brand .dot { color: var(--accent); }
.nav-links { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: var(--muted); padding: 6px 12px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
/* desktop: the menu holds links + theme toggle inline; hamburger hidden */
.nav-menu { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; font-family: inherit; }

/* phones: collapse the header into a hamburger + full-width dropdown */
@media (max-width: 768px) {
  .site-nav .nav-inner { position: relative; padding: 10px 14px; }
  .site-nav .nav-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 46px; height: 46px; font-size: 20px; line-height: 1; }
  .site-nav .nav-menu { display: none; position: absolute; top: calc(100% + 1px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 8px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 14px 30px rgba(0,0,0,.45);
    max-height: 78vh; overflow-y: auto; z-index: 60; }
  .site-nav.nav-open .nav-menu { display: flex; }
  .site-nav .nav-links { flex-direction: column; flex-wrap: nowrap; gap: 4px; width: 100%; }
  .site-nav .nav-links a { display: block; padding: 14px 16px; font-size: 1rem; border-radius: 10px; }
  .site-nav .nav-links a:hover, .site-nav .nav-links a.active { background: var(--surface-2); }
  .site-nav .nav-menu .theme-toggle { margin: 8px 4px 4px; align-self: flex-start; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 84px 0 56px;
  text-align: center;
  background:
    radial-gradient(1100px 420px at 50% -10%, rgba(91,140,255,0.18), transparent 70%),
    radial-gradient(800px 360px at 80% 0%, rgba(138,91,255,0.12), transparent 70%);
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 620px; margin: 0 auto; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.18em;
  font-size: 0.72rem; font-weight: 700; color: var(--accent); margin-bottom: 16px;
}

/* ---------- Section headings ---------- */
.section { padding: 56px 0; }
.section h2 { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -0.01em; }
.section .lead { color: var(--muted); margin: 0 0 28px; }

/* ---------- Hub card grid (home) ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; color: var(--text);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
.card .ico { font-size: 1.8rem; }
.card h3 { margin: 12px 0 6px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Buttons / external links ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 11px 18px; border-radius: 10px; border: 0; cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---------- Generic panel ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.panel + .panel { margin-top: 18px; }

/* Two-column layout */
.cols { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .cols.two { grid-template-columns: 1.3fr 1fr; } }

/* ---------- Lists of services / features ---------- */
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { padding: 8px 0 8px 28px; position: relative; border-bottom: 1px solid var(--border); }
.ticks li:last-child { border-bottom: 0; }
.ticks li::before { content: "✓"; color: var(--good); position: absolute; left: 0; font-weight: 800; }

/* ---------- Embed / emulator placeholder ---------- */
.embed-slot {
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface);
  min-height: 320px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 28px; color: var(--muted);
}
.embed-slot .inner { max-width: 460px; }
.embed-slot code { background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-family: var(--mono); color: var(--text); }

/* ---------- Tag / pill ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.pill {
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 11px; border-radius: 999px;
}

/* ---------- Blog ---------- */
.post {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 18px;
}
.post .meta { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.post h3 { margin: 6px 0 10px; font-size: 1.3rem; }
.post p { margin: 0 0 10px; }

/* ---------- placeholder link marker ---------- */
[data-todo] { position: relative; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 40px;
  padding: 28px 0; color: var(--muted); font-size: 0.9rem;
}
.site-footer .foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ---------- Music: artwork cards (click to play inline) ---------- */
body[data-page="music"] .mgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px; margin-top: 18px;
}
body[data-page="music"] .mcard {
  cursor: pointer; border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--surface); transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  display: block; text-decoration: none; color: inherit;
}
body[data-page="music"] .mcard:hover { text-decoration: none; }
body[data-page="music"] .mcard:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(0,0,0,.4);
}
body[data-page="music"] .mart {
  position: relative; aspect-ratio: 1 / 1; background-size: cover; background-position: center;
  background-color: #15171e; display: flex; align-items: center; justify-content: center;
}
body[data-page="music"] .mcard.noimg .mart {
  background: linear-gradient(135deg, #1db954, #0a7d3f);
}
body[data-page="music"] .mplay {
  width: 56px; height: 56px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem; padding-left: 3px;
  opacity: .92; transition: transform .14s ease, background .14s ease;
}
body[data-page="music"] .mcard:hover .mplay { transform: scale(1.12); background: #1db954; }
body[data-page="music"] .mname {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; font-weight: 600; color: var(--text);
}
body[data-page="music"] .mname .mnm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-page="music"] .mtype { flex: none; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
body[data-page="music"] .mcard.playing { cursor: default; grid-column: 1 / -1; border-color: var(--border); }
body[data-page="music"] .mcard.playing:hover { transform: none; box-shadow: none; }

/* ---------- Blog: feed, featured post, tag filter, article cards ---------- */
body[data-page="curiosity"] .bfilter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
body[data-page="curiosity"] .bfbtn { cursor: pointer; font: inherit; font-size: .82rem; padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
body[data-page="curiosity"] .bfbtn:hover { color: var(--text); border-color: var(--accent); }
body[data-page="curiosity"] .bfbtn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
body[data-page="curiosity"] .bpost { position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px 24px; margin-bottom: 22px; }
body[data-page="curiosity"] .bpost.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 16px 40px rgba(0,0,0,.4); }
body[data-page="curiosity"] .bflag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: #fff; background: var(--accent); padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }
body[data-page="curiosity"] .bcover { height: 200px; border-radius: 10px; background-size: cover; background-position: center;
  margin: 0 0 16px; background-color: #15171e; }
body[data-page="curiosity"] .bpost.featured .bcover { height: 280px; }
body[data-page="curiosity"] .bmeta { font-family: ui-monospace, Menlo, monospace; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); }
body[data-page="curiosity"] .btitle { margin: 4px 0 10px; font-size: 1.5rem; }
body[data-page="curiosity"] .bpost.featured .btitle { font-size: 2rem; }
body[data-page="curiosity"] .btags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
body[data-page="curiosity"] .btag { font-size: .76rem; color: var(--accent); }
body[data-page="curiosity"] .bcards { display: grid; gap: 12px; margin-top: 18px; }
body[data-page="curiosity"] .bcard { display: flex; text-decoration: none; color: var(--text); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; background: #0f1118; transition: border-color .12s, transform .12s; }
body[data-page="curiosity"] .bcard:hover { border-color: var(--accent); transform: translateY(-2px); }
body[data-page="curiosity"] .bcard-img { flex: none; width: 168px; background-size: cover; background-position: center; background-color: #1a1d27; }
body[data-page="curiosity"] .bcard-b { padding: 13px 15px; min-width: 0; }
body[data-page="curiosity"] .bcard-site { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
body[data-page="curiosity"] .bcard-t { font-weight: 700; margin: 3px 0 5px; }
body[data-page="curiosity"] .bcard-d { font-size: .9rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  body[data-page="curiosity"] .bcard { flex-direction: column; }
  body[data-page="curiosity"] .bcard-img { width: 100%; height: 160px; }
}
/* blog media: memes, inline video, social quote-cards, hashtags */
body[data-page="curiosity"] .bimg { display: block; max-width: 100%; border-radius: 12px; border: 1px solid var(--border); }
body[data-page="curiosity"] .bvideo iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 12px; }
body[data-page="curiosity"] .bvid-t { margin-top: 8px; font-size: .88rem; color: var(--muted); }
body[data-page="curiosity"] .bcard-img.noimg { display: flex; align-items: center; justify-content: center;
  font-size: 2rem; background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
body[data-page="curiosity"] .bcard.social { border-left: 3px solid var(--accent); }
body[data-page="curiosity"] .bcard.social .bcard-d { font-style: italic; }
body[data-page="curiosity"] .bhash { color: var(--accent); cursor: pointer; text-decoration: none; }
body[data-page="curiosity"] .bhash:hover { text-decoration: underline; }

/* ---------- Contact form (Consulting page) ---------- */
.cform { margin-top: 6px; }
.cform .cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .cform .cf-row { grid-template-columns: 1fr; } }
.cform input[type="text"], .cform input[type="email"], .cform textarea {
  width: 100%; padding: 11px 13px; margin-bottom: 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.cform input:focus, .cform textarea:focus { outline: none; border-color: var(--accent); }
.cform textarea { min-height: 120px; resize: vertical; }
.cform .cf-hp { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }
.cform .cf-msg { margin: 12px 0 0; font-size: .92rem; color: var(--muted); }
.cform .cf-msg.ok { color: var(--good); }
.cform .cf-msg.no { color: #ff8a8a; }

/* ============================================================
   THEME TOGGLE + GLOBAL LIGHT MODE
   Button appears on content pages only (home / desktop / XP shell
   don't include it). Light = data-theme="light" on <html>; dark
   is the default. Page-specific CSS layers on top of these vars.
   ============================================================ */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  font-family: var(--font); font-size: .78rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  transition: background .15s, border-color .15s, transform .1s;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:active { transform: translateY(1px); }
/* theme.js moves the button into the nav bar so it sits inline at the far
   right and reflows with the header — never overlapping, at any width. */
.site-nav .nav-inner .theme-toggle { margin-left: auto; }
/* Fallback only if JS hasn't relocated it (or there's no nav): float it clear
   of page content — top-right on desktop, bottom-right on phones. */
.theme-toggle:not(.theme-toggle--nav) {
  position: fixed; top: 10px; right: 14px; z-index: 60; box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
@media (max-width: 768px) {
  .theme-toggle:not(.theme-toggle--nav) { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

html[data-theme="light"] {
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #eceef2;
  --text: #16181d; --muted: #5b6270; --border: #d9dce3;
}
html[data-theme="light"] .site-nav { background: rgba(255,255,255,.85); }
html[data-theme="light"] body[data-page="music"] .mart,
html[data-theme="light"] body[data-page="curiosity"] .bcover,
html[data-theme="light"] body[data-page="curiosity"] .bcard-img { background-color: #e6e8ee; }
html[data-theme="light"] body[data-page="curiosity"] .bcard { background: #ffffff; }
html[data-theme="light"] .cform .cf-msg.no { color: #c0392b; }
