/* ============================================================
   Babak Askary — dark, minimal, Apple.
   Full-viewport views switched by the top menu. No page scroll.
   ============================================================ */

:root {
  --bg:        #000000;
  --bg-2:      #0a0a0c;
  --card:      #161618;
  --card-2:    #1c1c1e;
  --line:      rgba(255,255,255,.10);
  --line-2:    rgba(255,255,255,.16);

  --text:      #f5f5f7;
  --text-2:    #a1a1a6;
  --text-3:    #86868b;

  --accent:    #2997ff;   /* Apple dark-mode blue */
  --accent-hi: #57adff;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --nav-h: 56px;
  --wrap: 1040px;
  --radius: 20px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;               /* views manage their own scroll */
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em;
  background: rgba(255,255,255,.08); padding: 1px 5px; border-radius: 5px;
}

::selection { background: rgba(41,151,255,.32); color: #fff; }

/* thin, quiet scrollbars inside the views */
.view::-webkit-scrollbar { width: 8px; }
.view::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }
.view::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); }
.view { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 500;
  background: var(--text); color: #000; padding: 10px 16px; border-radius: 10px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

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

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: var(--nav-h);
  background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: var(--wrap); margin: 0 auto; height: 100%; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a {
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: color .2s var(--ease); position: relative; padding: 4px 0;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.nav__toggle {
  display: none; width: 40px; height: 40px; border: 0; background: none; cursor: pointer;
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav__toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s var(--ease); }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- view system ---------- */
.view {
  position: fixed; inset: 0; padding-top: var(--nav-h);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), visibility 0s linear .5s;
  -webkit-overflow-scrolling: touch;
}
.view.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .55s var(--ease), transform .55s var(--ease), visibility 0s;
}
.view__inner { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 40px 24px; }

/* views that can be taller than the screen scroll from the top */
.view--resume, .view--apps { align-items: flex-start; }
.view--resume .view__inner, .view--apps .view__inner { padding-top: 30px; padding-bottom: 124px; }

/* faint ambient glow keeps the inner views cohesive with home */
.view--apps, .view--resume, .view--contact {
  background: radial-gradient(72% 46% at 50% -6%, rgba(41,151,255,.075) 0%, rgba(0,0,0,0) 62%) var(--bg);
}

.view__head { margin-bottom: 34px; }
.view__title {
  font-size: clamp(38px, 6vw, 66px); line-height: 1; letter-spacing: -0.035em;
  background: linear-gradient(180deg, #ffffff 0%, #c9ced8 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.eyebrow {
  margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--accent);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 0;
  font-family: var(--sans); font-size: 16px; font-weight: 500;
  padding: 12px 24px; border-radius: 980px; white-space: nowrap;
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn--sm { font-size: 14px; padding: 9px 18px; }
.btn--primary { background: linear-gradient(180deg, #3aa0ff, #2997ff); color: #fff; box-shadow: 0 6px 20px rgba(41,151,255,.32); }
.btn--primary:hover { background: linear-gradient(180deg, #4aa8ff, #2f9dff); transform: translateY(-1px); box-shadow: 0 9px 26px rgba(41,151,255,.42); }
.btn--ghost { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--line-2); }
.btn--ghost:hover { background: rgba(255,255,255,.08); border-color: var(--text-2); transform: translateY(-1px); }

/* ---------- HOME ---------- */
.view--home { background: var(--bg); }

/* atmospheric background */
.home-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.home-bg__glow { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.home-bg__glow--1 {
  width: min(620px, 78vw); aspect-ratio: 1; top: -14%; left: 50%;
  background: radial-gradient(circle, rgba(41,151,255,.42), transparent 68%);
  transform: translateX(-50%); animation: drift1 16s ease-in-out infinite;
}
.home-bg__glow--2 {
  width: min(500px, 64vw); aspect-ratio: 1; bottom: -12%; left: 26%;
  background: radial-gradient(circle, rgba(120,86,255,.30), transparent 68%);
  animation: drift2 20s ease-in-out infinite;
}
.home-bg__spot {
  position: absolute; inset: 0;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 34%), rgba(90,175,255,.16), transparent 62%);
}
.home-bg__grain {
  position: absolute; inset: 0; opacity: .045; background-size: 130px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='130' height='130'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.home-bg::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(118% 80% at 50% 40%, transparent 46%, rgba(0,0,0,.55) 100%);
}
@keyframes drift1 { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 30px); } }
@keyframes drift2 { 0%,100% { transform: translate(0, 0); } 50% { transform: translate(34px, -26px); } }

.home__inner {
  max-width: 600px; margin: 0 auto; position: relative; z-index: 2; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.home__text { max-width: 560px; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.home__photo { line-height: 0; margin-bottom: 24px; }
.home__photo img {
  width: 100px; height: 100px; object-fit: cover; object-position: center;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 0 46px rgba(41,151,255,.32), 0 16px 38px rgba(0,0,0,.55);
}
.home__role { margin: 14px 0 0; font-size: 15px; letter-spacing: .01em; }

/* orchestrated entrance */
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes photoIn { from { opacity: 0; transform: translateY(20px) scale(.985); } to { opacity: 1; transform: none; } }
.home__text > * { animation: riseIn .85s var(--ease) both; }
.home__text > .home__photo { animation-delay: .04s; }
.home__text > .home__name  { animation-delay: .14s; }
.home__text > .home__role  { animation-delay: .26s; }
.home__text > .home__bio   { animation-delay: .40s; }
.home__text > .home__cta   { animation-delay: .52s; }
.home__name {
  font-size: clamp(40px, 5.2vw, 60px); line-height: 1.04; letter-spacing: -0.04em; font-weight: 600;
  background: linear-gradient(180deg, #ffffff 0%, #c9ced8 128%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home__bio {
  margin: 22px auto 0; max-width: 560px;
  font-size: clamp(16px, 1.7vw, 18px); line-height: 1.6; color: var(--text-2);
}
.home__cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
/* ---------- APPS ---------- */
.apps-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.app {
  position: relative;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 16px;
  transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.app:hover { transform: translateY(-4px); border-color: rgba(41,151,255,.34); background: var(--card-2); box-shadow: 0 18px 44px rgba(0,0,0,.42); }
.app__icon {
  width: 76px; height: 76px; border-radius: 18px; display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 18px rgba(0,0,0,.4);
  transition: transform .25s var(--ease);
}
.app:hover .app__icon { transform: scale(1.05) translateY(-1px); }
.app__icon--deepremove { background: linear-gradient(160deg, #6a5cff, #8f7bff); }
.app__icon--nerkheh    { background: linear-gradient(160deg, #16b374, #34d399); }
.app__icon--fit        { background: linear-gradient(160deg, #ff6f91, #ff9472); }
.app__icon--taskara    { background: linear-gradient(160deg, #2b8bff, #4fc3ff); }
.app__icon--mdm        { background: #000; overflow: hidden; padding: 0; }
.app__icon--mdm img     { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.app__body { flex: 1; }
.app__name { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; }
.app__meta { margin: 3px 0 0; font-size: 13px; color: var(--text-3); }
.app__desc { margin: 12px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.app__cta { align-self: flex-start; font-size: 15px; font-weight: 500; color: var(--accent); }
.app__cta:hover { color: var(--accent-hi); }
.badge {
  position: absolute; top: 26px; right: 26px;
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  color: var(--text-2); background: rgba(255,255,255,.08); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 980px;
}

/* platform groups */
.app-group { margin-bottom: 40px; }
.app-group:last-child { margin-bottom: 0; }
.app-group__head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.app-group__icon {
  color: var(--text-2); display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
}
.app-group__label { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }

/* card footer + actions */
.app__foot { margin-top: auto; display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.app__dmg {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: #fff; background: var(--accent);
  padding: 9px 18px; border-radius: 980px;
  transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.app__dmg:hover { background: var(--accent-hi); transform: translateY(-1px); }
.app__dmg--ghost { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--line-2); }
.app__dmg--ghost:hover { background: rgba(255,255,255,.08); border-color: var(--text-2); }
.app__note { font-size: 12.5px; color: var(--text-3); }
.app__note--link { color: var(--accent); font-weight: 500; }
.app__note--link:hover { color: var(--accent-hi); }

/* App Store badge */
.asbadge-link { display: inline-flex; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.asbadge-link:hover { transform: translateY(-1px); opacity: .9; }
.asbadge-soon { display: inline-flex; }
.asbadge { display: block; }

/* featured wide card (single Web app) */
@media (min-width: 821px) {
  .app--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 26px; }
  .app--wide .app__body { flex: 1; }
  .app--wide .app__foot { margin-top: 0; flex-direction: row; align-items: center; gap: 16px; }
}

/* ---------- RÉSUMÉ ---------- */
.resume__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.resume__tools { display: flex; gap: 10px; }
#view-pdf { border-color: rgba(255,255,255,.34); color: var(--text); }
.resume {
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0) 120px) var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 3.5vw, 40px);
}
.resume__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 52px); }
.rblock { margin-bottom: 28px; }
.rblock:last-child { margin-bottom: 0; }
.rblock__title {
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.ritem { margin-bottom: 16px; }
.ritem:last-child { margin-bottom: 0; }
.ritem__line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ritem__org { font-weight: 600; font-size: 15px; }
.ritem__date { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.ritem__role { margin: 2px 0 0; font-size: 14.5px; font-weight: 500; color: var(--text); }
.ritem__note { margin: 5px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.ritem__note strong { color: var(--text); font-weight: 600; }
.rlist { margin: 0; padding-left: 18px; }
.rlist li { font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.rblock > .ritem__note + .ritem__note { margin-top: 12px; }

/* ---------- CONTACT ---------- */
.contact__inner { max-width: 720px; text-align: center; }
.contact__lede { margin: 16px 0 0; font-size: clamp(17px, 2vw, 20px); color: var(--text-2); }
.contact__links {
  margin: 40px 0 0; display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); text-align: left;
}
.clink {
  display: flex; align-items: center; gap: 15px; text-align: left;
  padding: 17px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
a.clink:hover {
  background: var(--card-2); border-color: rgba(41,151,255,.34);
  transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.4);
}
.clink__icon {
  flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; color: var(--text-2);
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  transition: color .2s var(--ease), background .2s var(--ease);
}
a.clink:hover .clink__icon { color: var(--accent); background: rgba(41,151,255,.10); }
.clink__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.clink__label { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.clink__val { font-size: 15.5px; color: var(--text); font-weight: 500; word-break: break-word; }
.clink--static { cursor: default; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal__panel {
  position: relative; width: min(920px, 96vw); height: min(88vh, 1100px);
  background: #1c1c1e; border: 1px solid var(--line-2); border-radius: 16px; overflow: hidden;
  display: flex; flex-direction: column; animation: pop .3s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); background: #161618;
}
.modal__title { font-size: 13px; font-weight: 500; color: var(--text-2); }
.modal__bar-actions { display: flex; align-items: center; gap: 8px; }
.modal__close { width: 34px; height: 34px; border: 0; background: rgba(255,255,255,.1); border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--text); }
.modal__close:hover { background: rgba(255,255,255,.18); }
.modal__body { flex: 1; background: #333; }
.modal__body iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- contact dock (persistent, bottom) ---------- */
.footdock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; justify-content: center; gap: 20px;
  padding: 30px 0 max(18px, env(safe-area-inset-bottom));
  pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.6) 45%, rgba(0,0,0,0) 100%);
  transition: opacity .3s var(--ease);
}
.footdock::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent);
  mask-image: linear-gradient(to top, #000 55%, transparent);
}
/* the Contact view already presents these links as cards — don't show them twice */
body:has(#contact.is-active) .footdock { opacity: 0; pointer-events: none; }
/* optical balance: the boxed LinkedIn mark reads heavier, the envelope lighter */
.footdock__link[aria-label="LinkedIn"] svg { transform: scale(.92); }
.footdock__link[aria-label="Email Babak"] svg { transform: scale(1.1); }
.footdock__link {
  pointer-events: auto; color: var(--text-3);
  display: inline-flex; padding: 8px;
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.footdock__link:hover { color: var(--text); transform: translateY(-2px); }
.view__title, .contact__lede, .section__lede { text-wrap: balance; }
.home__bio, .app__desc { text-wrap: pretty; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: #f5f5f7; color: #000; padding: 13px 20px; border-radius: 980px;
  font-size: 14.5px; font-weight: 500; z-index: 400; box-shadow: 0 10px 40px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .28s var(--ease), transform .28s var(--ease); max-width: 90vw; text-align: center;
}
.toast[hidden] { display: none; }
.toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 820px) {
  .apps-grid { grid-template-columns: 1fr; }
  .resume__grid { grid-template-columns: 1fr; gap: 26px; }

  .home__inner { max-width: 560px; }
  .home__photo img { width: 84px; height: 84px; box-shadow: 0 0 0 1px rgba(255,255,255,.22), 0 0 34px rgba(41,151,255,.30), 0 10px 24px rgba(0,0,0,.5); }
  .home__bio { max-width: none; }
}

@media (max-width: 640px) {
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(10,10,12,.96);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: 15px 24px; font-size: 16px; border-top: 1px solid var(--line); }
  .nav__links a.is-active::after { display: none; }
  .nav__toggle { display: flex; }
  .home__stats { gap: 26px; }
  .contact__links { grid-template-columns: 1fr; }
}

/* short screens: let home breathe / scroll if it must */
@media (max-height: 620px) {
  .view { align-items: flex-start; }
  .view__inner { padding-top: 24px; padding-bottom: 40px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- print (résumé) ---------- */
@media print {
  body { overflow: visible; background: #fff; color: #000; }
  .nav, .toast, .modal, .skip-link, .resume__tools, .view__head .eyebrow { display: none !important; }
  .view { position: static; opacity: 1; visibility: visible; transform: none; display: block; height: auto; padding: 0; }
  .view:not(#resume) { display: none !important; }
  .resume { border: 0; background: #fff; color: #000; padding: 0; }
  .rblock__title { color: #000; }
  .ritem__note, .ritem__role, .ritem__org, .rlist li, .ritem__date { color: #000 !important; }
}
