/* ==========================================================
   Fonts — Child Hood (Latin) · Thmanyah Sans (Arabic)
   ========================================================== */
@font-face { font-family: "Child Hood"; src: url("assets/fonts/ChildHood.otf") format("opentype"); font-weight: 400 700; font-style: normal; font-display: swap; }

@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/ThmanyahSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/ThmanyahSans-Medium.woff2") format("woff2"); font-weight: 500 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/ThmanyahSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ==========================================================
   Theme (silver palette)
   ========================================================== */
:root {
  --primary: #cbd1d6;
  --secondary: #828689;
  --secondary-2: #a6abaf;
  --ink: #1f2326;
  --surface: rgba(255, 255, 255, .55);
  --surface-hover: rgba(255, 255, 255, .78);
  --line: rgba(47, 52, 56, .12);
  --line-strong: rgba(47, 52, 56, .22);
  --shadow: 0 18px 50px rgba(40, 46, 52, .12);
  --card-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 14px 34px rgba(40, 46, 52, .12);
  --body-a: #eef1f3;
  --body-b: #cbd1d6;
  --body-c: #a6abaf;
  --glow-tl: color-mix(in srgb, #ffffff 55%, var(--primary));
  --glow-br: color-mix(in srgb, var(--secondary-2) 70%, #ffffff);
  --glow-tr: color-mix(in srgb, var(--primary) 60%, #ffffff);
  --glow-tl-o: .55;
  --glow-br-o: .45;
  --glow-tr-o: .35;
  --particle: rgba(31, 35, 38, .28);
  --wash-hi: color-mix(in srgb, var(--body-a) 70%, white);

  --radius: 18px;
  --font: "Child Hood", "Thmanyah Sans", "Segoe UI", sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #2a2e32;
    --secondary: #9aa0a6;
    --secondary-2: #7d848a;
    --ink: #eef1f3;
    --surface: rgba(28, 31, 34, .72);
    --surface-hover: rgba(40, 44, 48, .88);
    --line: rgba(255, 255, 255, .1);
    --line-strong: rgba(255, 255, 255, .18);
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
    --card-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 14px 34px rgba(0, 0, 0, .4);
    --body-a: #14171a;
    --body-b: #1f2326;
    --body-c: #2d3338;
    --glow-tl: color-mix(in srgb, #cbd1d6 35%, transparent);
    --glow-br: color-mix(in srgb, #828689 40%, transparent);
    --glow-tr: color-mix(in srgb, #cbd1d6 20%, transparent);
    --glow-tl-o: .35;
    --glow-br-o: .3;
    --glow-tr-o: .25;
    --particle: rgba(238, 241, 243, .35);
    --wash-hi: color-mix(in srgb, var(--body-a) 85%, #3a4045);
    color-scheme: dark;
  }
}

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

html {
  font-size: 17.5px;
  letter-spacing: .01em;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--body-a);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(130, 134, 137, .35);
}

/* ==========================================================
   Background — silver wash, perspective grid, glows, particles
   ========================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 520px at 18% 12%, var(--wash-hi), transparent 60%),
    radial-gradient(700px 480px at 82% 18%, color-mix(in srgb, var(--body-c) 50%, transparent), transparent 58%),
    radial-gradient(800px 500px at 50% 100%, color-mix(in srgb, var(--secondary) 20%, transparent), transparent 55%),
    linear-gradient(145deg, var(--body-a) 0%, var(--body-b) 46%, var(--body-c) 100%);
}

.bg-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(700px) rotateX(58deg) scale(1.35);
  transform-origin: center 10%;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 78%);
          mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 78%);
  animation: grid-move 6s linear infinite;
}
@keyframes grid-move {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 0 48px, 0 0; }
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  will-change: transform;
}
.bg-glow.tl {
  width: min(52vw, 420px); height: min(52vw, 420px);
  left: -8%; top: -12%;
  background: var(--glow-tl); opacity: var(--glow-tl-o);
  animation: glow-a 18s ease-in-out infinite alternate;
}
.bg-glow.br {
  width: min(58vw, 460px); height: min(58vw, 460px);
  right: -10%; bottom: -14%;
  background: var(--glow-br); opacity: var(--glow-br-o);
  animation: glow-b 22s ease-in-out infinite alternate;
}
.bg-glow.tr {
  width: min(36vw, 280px); height: min(36vw, 280px);
  right: 8%; top: 10%;
  background: var(--glow-tr); opacity: var(--glow-tr-o);
  animation: glow-a 26s ease-in-out infinite alternate-reverse;
}
@keyframes glow-a { to { transform: translate(60px, 40px) scale(1.08); } }
@keyframes glow-b { to { transform: translate(-50px, -40px) scale(1.1); } }

/* Floating particles (generated in script.js) */
.particles { position: absolute; inset: 0; }
.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--particle);
  opacity: .15;
  animation: particle var(--dur, 5s) ease-in-out var(--delay, 0s) infinite;
  will-change: transform, opacity;
}
@keyframes particle {
  0%, 100% { transform: translateY(0) scale(1); opacity: .15; }
  33%      { transform: translateY(-28px) scale(1.4); opacity: .7; }
  66%      { transform: translateY(12px) scale(.9); opacity: .25; }
}

/* ==========================================================
   Layout
   ========================================================== */
.page {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: max(56px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ==========================================================
   Profile
   ========================================================== */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 18px;
}

.avatar {
  position: relative;
  margin: 0 0 18px;
  width: 112px;
  height: 112px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 10px 24px rgba(40, 46, 52, .18), 0 0 0 6px var(--surface), 0 0 0 7px var(--line);
}

.name {
  margin: 0;
  font-size: clamp(1.85rem, 3.4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .01em;
}

.caption {
  margin: 10px 0 0;
  max-width: 34ch;
  color: var(--secondary);
  font-size: .92rem;
  line-height: 1.6;
  text-wrap: pretty;
}

/* ==========================================================
   Links — panel buttons
   ========================================================== */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 9px 16px 9px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

/* Icon tile = primary button */
.ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  color: #eef1f3;
  background: linear-gradient(180deg, #2a2f33 0%, #1f2326 100%);
  box-shadow: 0 10px 24px rgba(31, 35, 38, .22);
  transition: background 160ms ease;
}
.ic svg { width: 21px; height: 21px; fill: currentColor; shape-rendering: geometricPrecision; }
.ic svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; }
.ic svg.stroke .dot { fill: currentColor; stroke: none; }

.lt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lt b { font-weight: 600; font-size: 1.02rem; letter-spacing: .01em; }

.arrow {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--secondary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease, stroke 160ms ease;
}

@media (hover: hover) {
  .link:hover {
    background: var(--surface-hover);
    border-color: var(--line-strong);
    box-shadow: var(--card-shadow), var(--shadow);
  }
  .link:hover .ic { background: linear-gradient(180deg, #343a3f 0%, #252a2e 100%); }
  .link:hover .arrow { stroke: var(--ink); transform: translate(2px, -2px); }
}
.link:active { transform: translateY(1px); }

/* ==========================================================
   Entrance animation (only when JS is running)
   ========================================================== */
.js .reveal { opacity: 0; transform: translateY(8px); }
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .6s cubic-bezier(.22, .8, .28, 1), transform .6s cubic-bezier(.22, .8, .28, 1);
  transition-delay: var(--d, 0ms);
}
.js .link.reveal.done {
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  transition-delay: 0ms;
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 380px) {
  html { font-size: 16px; }
  .page { padding-top: 40px; }
  .avatar { width: 96px; height: 96px; }
  .link { min-height: 58px; gap: 12px; }
  .ic { width: 42px; height: 42px; }
}

@media (min-width: 768px) {
  .page { padding-top: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: .01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
