/* ========= RESET ========= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }
body, h1, h2, p, ul { margin: 0; }

img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ========= THEME TOKENS ========= */
:root {
  --bg-base: #eaf8f3;
  --text: #0b1220;
  --muted: #4b5563;
  --accent: #06b6d4;
  --accent-2: #9333ea;
  --header-bg: rgba(255, 255, 255, 0.72);
  --border: rgba(0, 0, 0, 0.10);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.06);

  /* toggle colors (light) */
  --toggle-bg: rgba(6, 182, 212, 0.18); /* matches your light theme vibe */
  --toggle-fg: var(--text);
}

:root.dark {
  --bg-base: rgba(15, 23, 42, 0.65);
  --text: #eaf1ff;
  --muted: #9aa7bd;
  --header-bg: rgba(17, 24, 39, 0.55);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 18px 50px rgba(2, 6, 23, 0.45);

  /* toggle colors (dark) */
  --toggle-bg: rgba(255,255,255,0.06);
  --toggle-fg: var(--text);
}

/* ========= GLOBAL ========= */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg-base);
  color: var(--text);
  margin-top: 70px;   /* fixed header offset */
  line-height: 1.6;
  transition: background 0.4s ease, color 0.3s ease;
  position: relative;
  overflow-x: hidden;
}

/* Dark frosted sheet */
:root.dark body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(40% 60% at 80% 10%, rgba(6, 182, 212, 0.18), transparent 60%),
    radial-gradient(40% 60% at 15% 60%, rgba(147, 51, 234, 0.14), transparent 60%),
    rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  pointer-events: none; z-index: -1;
}

.container { width: min(1100px, 92%); margin-inline: auto; }

/* ========= HEADER ========= */
.header {
  position: fixed; top: 0; left: 0; width: 100%;
  z-index: 9999;
  backdrop-filter: saturate(1.2) blur(12px);
  -webkit-backdrop-filter: saturate(1.2) blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0;
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand__logo {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: contain; padding: 2px; transition: transform .3s ease;
}
.brand__logo:hover { transform: scale(1.1); }
.brand__name { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 700; }

/* Nav */
.nav__toggle { display: none; }
.nav__list { display: flex; gap: .75rem; }
.nav__list a {
  text-decoration: none; color: var(--text); font-weight: 600;
  padding: .4rem .8rem; border-radius: 8px; transition: background .25s, color .25s;
}
.nav__list a:hover { background: rgba(0,0,0,0.06); color: var(--accent); }
:root.dark .nav__list a:hover { background: rgba(255,255,255,0.08); }

/* Header actions */
.header__actions { display: flex; align-items: center; gap: 8px; }

/* ===== Font Awesome Toggle (circle-half-stroke) ===== */
.fa-toggle{
  --size: 40px;
  display:inline-flex; align-items:center; justify-content:center;
  width: var(--size); height: var(--size);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--toggle-bg);     /* matches theme */
  color: var(--toggle-fg);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 4px 14px rgba(0,0,0,.06);
  transition: background .25s ease, transform .08s ease, box-shadow .2s ease, border-color .25s ease;
}
.fa-toggle i { font-size: 18px; line-height: 1; transition: transform .28s ease, opacity .28s ease; }
.fa-toggle:hover { transform: translateY(-1px); }
.fa-toggle:active { transform: translateY(0); }
.fa-toggle:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 35%, transparent); }

/* Spin/tilt cue when theme changes */
:root.dark .fa-toggle i { transform: rotate(180deg); }

/* ========= SOCIAL ICONS ========= */
.social {
  width: 42px; height: 42px; border-radius: 50%;
  display:inline-flex; align-items:center; justify-content:center;
  overflow:hidden; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, background .3s;
}
:root.dark .social { background: rgba(255,255,255,0.06); }
.social:hover { transform: translateY(-2px); }
.social img { width: 98%; height: 98%; object-fit: contain; }

/* ========= HERO ========= */
.hero { padding: 56px 0 24px; }
.hero__title { font-family: "Space Grotesk", Inter, sans-serif; font-size: clamp(2rem, 5vw, 3.5rem); }
.hero__subtitle { color: var(--muted); margin-top: 10px; max-width: 60ch; }
.accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ========= SECTIONS ========= */
.sections, .projects, .wallpapers, .about, .contact { padding: 40px 0; }

/* ========= BUTTON ========= */
.btn { background: var(--accent); color: #fff; padding: .75rem 1.25rem; border: none; border-radius: 8px; cursor: pointer; font-weight: 700; }
.btn:hover { background: var(--accent-2); }

/* ========= FORM ========= */
form { display: grid; gap: 12px; max-width: 520px; }
form input, form textarea {
  padding: .75rem; border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,0.9); color: var(--text);
}
:root.dark form input, :root.dark form textarea { background: rgba(255,255,255,0.06); }

/* ========= FOOTER ========= */
.footer {
  margin-top: 1.5rem;
  font-size: .95rem;
  padding: 1rem 0;
  text-align: center;
  color: #666;
  background: #fff;
  border-top: 1px solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root.dark .footer { background: var(--content-bg, #0b1220); color: var(--muted); }

.footer__text { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.heart { display:inline-block; transform-origin:center; }
@keyframes pulse { 0%,100%{ transform: scale(1)} 50%{ transform: scale(1.12)} }
.heart { animation: pulse 1.6s ease-in-out infinite; }

/* Typewriter caret */
.typewriter { font-family: ui-monospace, monospace; border-right: 2px solid currentColor; overflow: hidden; white-space: nowrap; }
.typewriter.done { animation: none !important; border-right: 0 !important; }
@keyframes caret-blink { 0%, 100% { opacity: 1 } 50% { opacity: 0 } }
.typewriter { animation: caret-blink .9s step-end infinite; }

@media (prefers-reduced-motion: reduce) {
  .typewriter { animation: none; border-right: 0; }
  .heart { animation: none; }
}

/* Accessibility */
.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; }

/* Mobile nav */
@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: transparent; }
  .nav__hamburger { width: 20px; height: 2px; background: var(--text); position: relative; }
  .nav__hamburger::before, .nav__hamburger::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: var(--text); }
  .nav__hamburger::before { top: -6px; } .nav__hamburger::after { top: 6px; }

  .nav__list { position: fixed; inset: 64px 16px auto 16px; display: none; flex-direction: column; gap: 10px; background: var(--header-bg); border: 1px solid var(--border); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
  .nav__list.is-open { display: flex; }

  .header__inner { gap: 8px; }
  .brand { order: 1; display: inline-flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
  .header__actions { order: 2; flex: 0 0 auto; justify-content: flex-end; gap: 6px; }
  .nav { order: 3; }

  .social, .nav__toggle, .fa-toggle { width: 36px; height: 36px; border-radius: 10px; }
  .social img { width: 80%; height: 80%; object-fit: contain; }

  .brand__name { max-width: clamp(120px, 30vw, 180px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 420px) {
  .brand__name { display: none; }
  .brand__logo { width: 38px; height: 38px; }
}

/* Footer wrap on small screens */
@media (max-width: 600px) {
  .footer { white-space: normal; overflow: visible; text-overflow: clip; }
  .footer__text { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: center; max-width: 100%; overflow: visible; text-overflow: clip; }
  #typeLine.typewriter { display: inline-block; max-width: 100%; }
}
