/* mustafaer.net — warm editorial, light and dark. Accent is MEDEV's ember. */

:root {
  --bg: #f5f1ea;
  --surface: #fffdf9;
  --surface-2: #efe9df;
  --ink: #17140f;
  --ink-2: #3d372f;
  --muted: #6e665b;
  --line: #e2dacd;
  --accent: #d9530c;
  --accent-ink: #ffffff;
  --accent-soft: #fbe3d3;
  --band: #121316;
  --band-2: #1b1d22;
  --band-ink: #f2ede4;
  --band-muted: #a59d90;
  --band-line: #2c2f35;
  --ok: #1f9d55;
  --shadow: 0 1px 2px rgba(23, 20, 15, .06), 0 12px 32px -12px rgba(23, 20, 15, .18);
  --radius: 18px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0e0c;
    --surface: #181612;
    --surface-2: #211e19;
    --ink: #f2ede4;
    --ink-2: #d6cfc3;
    --muted: #a39a8c;
    --line: #2d2922;
    --accent: #ff7a1a;
    --accent-ink: #1a0d03;
    --accent-soft: #3a2010;
    --band: #08090b;
    --band-2: #121418;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f0e0c;
  --surface: #181612;
  --surface-2: #211e19;
  --ink: #f2ede4;
  --ink-2: #d6cfc3;
  --muted: #a39a8c;
  --line: #2d2922;
  --accent: #ff7a1a;
  --accent-ink: #1a0d03;
  --accent-soft: #3a2010;
  --band: #08090b;
  --band-2: #121418;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex: none; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
@media (min-width: 720px) { .wrap { width: min(1160px, 100% - 64px); } }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--ink); color: var(--accent);
  font: italic 400 19px/1 var(--serif);
}
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; transition: color .15s, background .15s;
}
.nav a:hover, .nav a.active { color: var(--ink); background: var(--surface-2); }
.header-actions { display: flex; gap: 6px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--muted); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: block; }
}
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .menu-toggle { display: grid; }
  .header-actions { margin-left: auto; }
  .nav {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-radius: 10px; font-size: 17px; }
}

/* ---------- Type & shared ---------- */
.display { font-family: var(--serif); font-weight: 400; letter-spacing: -.015em; line-height: 1.02; }
.display em { font-style: italic; color: var(--accent); }
.label {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.label span { color: var(--accent); }
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-head { display: grid; gap: 14px; margin-bottom: 40px; }
.section-head h2, .channels h2, .contact h2 { font-size: clamp(40px, 6vw, 64px); }
.section-lead { color: var(--muted); font-size: 18px; max-width: 62ch; }
.group-title { font: 500 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 48px 0 16px; }
.group-title:first-of-type { margin-top: 0; }
.kind { display: block; font: 500 12px/1.3 var(--mono); color: var(--accent); letter-spacing: .02em; margin-bottom: 8px; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid transparent; font: 600 15px/1 var(--sans);
  text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr);
  gap: clamp(32px, 6vw, 80px); align-items: center;
  padding-block: clamp(40px, 8vw, 96px) clamp(56px, 9vw, 112px);
}
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 28px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); }
.hero h1 { font-size: clamp(44px, 7.2vw, 88px); }
.hero .lead { margin-top: 24px; font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 58ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px;
  margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line);
}
.facts dt { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.facts dd { font-size: 15px; font-weight: 500; }

.portrait { position: relative; }
.portrait > img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 28px;
  box-shadow: var(--shadow); background: var(--surface-2);
}
.portrait::before {
  content: ""; position: absolute; inset: 18px -18px -18px 18px; z-index: -1;
  border-radius: 28px; background: var(--accent-soft);
}
.badge-card {
  position: absolute; left: -24px; bottom: 28px;
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.badge-card img { border-radius: 10px; }
.badge-card span { display: grid; line-height: 1.2; }
.badge-card strong { font-size: 15px; }
.badge-card small { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .portrait { max-width: 420px; margin-inline: auto 24px; order: -1; }
  .badge-card { left: 12px; }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .portrait { margin-inline: 0 18px; }
}

/* ---------- Studio band ---------- */
.studio {
  background: var(--band); color: var(--band-ink);
  padding-block: clamp(72px, 10vw, 128px);
  position: relative; overflow: hidden; isolation: isolate;
}
.studio::before {
  content: ""; position: absolute; z-index: -1; width: 720px; height: 720px; right: -220px; top: -260px;
  background: radial-gradient(closest-side, rgba(255, 122, 26, .22), transparent);
}
.studio .label { color: var(--band-muted); }
.studio .label span { color: #ff7a1a; }
.studio h2 { font-size: clamp(48px, 8vw, 96px); }
.studio-line { font: italic 400 clamp(26px, 3.4vw, 38px)/1.15 var(--serif); color: var(--band-ink); }
.studio-line em { color: #ff7a1a; }
.studio .section-lead { color: var(--band-muted); }

.games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.games a {
  display: flex; align-items: center; gap: 16px; padding: 14px; text-decoration: none;
  background: var(--band-2); border: 1px solid var(--band-line); border-radius: var(--radius);
  transition: transform .2s, border-color .2s;
}
.games a:hover { transform: translateY(-3px); border-color: #ff7a1a; }
.games img { width: 72px; height: 72px; border-radius: 18px; }
.games span { display: grid; gap: 2px; }
.games strong { font-size: 17px; }
.games small { color: var(--band-muted); font-size: 14px; }
@media (max-width: 900px) { .games { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .games { grid-template-columns: 1fr; } }

.studio-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; }
.studio .btn-accent { background: #ff7a1a; color: #1a0d03; }
.chip-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--band-line); border-radius: 999px; text-decoration: none;
  color: var(--band-ink); font-size: 15px; font-weight: 500;
}
.chip-link:hover { border-color: var(--band-muted); }

/* ---------- Work ---------- */
.oss { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.oss a {
  position: relative; display: block; height: 100%; padding: 22px 48px 22px 22px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.oss a:hover, .apps a:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.oss strong { display: block; font-size: 17px; line-height: 1.3; }
.oss p { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.oss .more { display: flex; align-items: center; gap: 12px; background: var(--surface-2); }
.oss .gh { width: 24px; height: 24px; }
.go { position: absolute; right: 18px; top: 20px; color: var(--muted); transition: color .15s, transform .15s; }
a:hover > .go { color: var(--accent); transform: translate(2px, -2px); }
@media (max-width: 900px) { .oss { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .oss { grid-template-columns: 1fr; } }

.apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.apps a {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 48px 16px 16px;
  text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.apps img { width: 60px; height: 60px; border-radius: 16px; }
.apps span { display: grid; gap: 2px; }
.apps strong { font-size: 17px; }
.apps small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.apps .go { top: 50%; margin-top: -9px; }
@media (max-width: 680px) { .apps { grid-template-columns: 1fr; } }

.cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.cases li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cases figure { aspect-ratio: 16 / 9; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.cases figure img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .5s; }
.cases li:hover figure img { transform: scale(1.03); }
.cases .ph {
  display: grid; place-items: center; text-align: left;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--surface-2);
}
.cases .ph span { font: 500 clamp(20px, 2.6vw, 28px)/1.3 var(--mono); color: var(--ink-2); padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.cases li > div { padding: 20px 22px 24px; }
.cases strong { display: block; font-size: 18px; }
.cases p { margin-top: 6px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.text-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-weight: 600; font-size: 15px; color: var(--accent); text-decoration: none; }
.text-link .i { width: 15px; height: 15px; }
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }

/* ---------- Experience ---------- */
.timeline { border-top: 1px solid var(--line); }
.timeline > li {
  display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px;
  padding-block: 28px; border-bottom: 1px solid var(--line);
}
.when { font: 500 13px/1.6 var(--mono); color: var(--muted); padding-top: 4px; }
.timeline h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.timeline h3 span { font-weight: 400; color: var(--muted); }
.timeline p:not(.when) { margin-top: 8px; color: var(--ink-2); max-width: 70ch; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tags li { font: 500 12px/1 var(--mono); padding: 7px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.timeline > li:first-child .when { color: var(--accent); }
@media (max-width: 700px) { .timeline > li { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Stack ---------- */
.stack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stack > div { padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stack h3 { font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.stack ul { display: flex; flex-wrap: wrap; gap: 8px; }
.stack li { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 15px; font-weight: 500; }
.stack li.strong { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 980px) { .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stack { grid-template-columns: 1fr; } }

/* ---------- Channels ---------- */
.channels {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding-top: 0;
}
.channels > div:first-child { display: grid; gap: 14px; }
.channel-links { display: grid; gap: 12px; }
.channel {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 20px 52px 20px 20px;
  text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .2s, box-shadow .2s;
}
.channel:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.channel > .i:first-child { width: 30px; height: 30px; }
.channel.yt > .i:first-child { color: #ff0033; }
.channel.tw > .i:first-child { color: #9146ff; }
.channel span { display: grid; }
.channel strong { font-size: 18px; }
.channel small { color: var(--muted); font-size: 14px; }
.channel .go { top: 50%; margin-top: -9px; }
@media (max-width: 760px) { .channels { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Contact ---------- */
.contact { padding-block: clamp(72px, 10vw, 128px); background: var(--surface-2); border-top: 1px solid var(--line); }
.contact-inner { display: grid; gap: 18px; justify-items: start; }
.contact h2 { font-size: clamp(48px, 8vw, 104px); }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 10px; }
.mail {
  font: 400 clamp(26px, 4vw, 44px)/1.1 var(--serif); text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat; padding-bottom: 4px;
  overflow-wrap: anywhere;
}
.mail:hover { color: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.socials a {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); transition: transform .15s, border-color .15s, color .15s;
}
.socials a:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.socials .i { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 28px; font-size: 14px; color: var(--muted); }
.footer-inner a { color: var(--ink); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Motion ---------- */
.motion .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.motion .reveal.in { opacity: 1; transform: none; }
.motion .hero-copy > * { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.motion .hero-copy > :nth-child(2) { animation-delay: .06s; }
.motion .hero-copy > :nth-child(3) { animation-delay: .12s; }
.motion .hero-copy > :nth-child(4) { animation-delay: .18s; }
.motion .hero-copy > :nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
