/* =========================================================
   Inzamam Ul Haq — iOS Developer Portfolio
   Design language: iOS / App Store product page
   Display: Bricolage Grotesque · UI/body: Inter · Data: JetBrains Mono
   Signature: App Store product-page hero + squircle cards + phone gallery
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Accents — Swift-coral to iOS-indigo (grounded in the subject, not a default) */
  --coral: #FF6A3D;
  --indigo: #6D5EF6;
  --grad: linear-gradient(135deg, var(--coral) 0%, var(--indigo) 100%);

  /* Dark theme (default) */
  --bg: #0B0B0F;
  --bg-2: #101017;
  --surface: #16161D;
  --surface-2: #1C1C26;
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.14);
  --text: #F5F5F7;
  --text-2: #A0A0AC;
  --text-3: #6C6C78;
  --pill: rgba(255,255,255,0.06);

  /* Type scale */
  --f-display: "Bricolage Grotesque", system-ui, sans-serif;
  --f-ui: "Inter", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Radii — squircle feel */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;

  --maxw: 1120px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="light"] {
  --bg: #F4F4F6;
  --bg-2: #ECECEF;
  --surface: #FFFFFF;
  --surface-2: #FFFFFF;
  --line: rgba(0,0,0,0.08);
  --line-2: rgba(0,0,0,0.12);
  --text: #16161A;
  --text-2: #55555F;
  --text-3: #8A8A94;
  --pill: rgba(0,0,0,0.04);
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--f-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

h1,h2,h3 { font-family: var(--f-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow--accent {
  color: transparent;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.nav__mark { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.nav__glyph {
  font-family: var(--f-mono); font-size: .7rem; font-weight: 600;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 14px rgba(109,94,246,.35);
}
.nav__name { font-size: .95rem; letter-spacing: -0.01em; }
.nav__links { display: flex; gap: 1.4rem; }
.nav__links a { font-size: .9rem; color: var(--text-2); transition: color .2s; }
.nav__links a:hover { color: var(--text); }

.theme-toggle {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--pill);
  color: var(--text); cursor: pointer; transition: background .2s, transform .2s;
}
.theme-toggle:hover { transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle__moon { display: none; }
[data-theme="light"] .theme-toggle__sun { display: none; }
[data-theme="light"] .theme-toggle__moon { display: block; }

@media (max-width: 620px) { .nav__links { display: none; } }

/* ---------- Hero (App Store product page) ---------- */
.hero { position: relative; padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2.5rem) clamp(2rem, 5vw, 4rem); overflow: hidden; }
.hero__glow {
  position: absolute; inset: -20% 0 auto 0; height: 60vh; z-index: 0;
  background:
    radial-gradient(50% 60% at 20% 0%, color-mix(in srgb, var(--coral) 30%, transparent), transparent 70%),
    radial-gradient(50% 60% at 85% 10%, color-mix(in srgb, var(--indigo) 32%, transparent), transparent 70%);
  filter: blur(20px); opacity: .8; pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; }
.hero__head { display: flex; gap: clamp(1.2rem, 4vw, 2.6rem); align-items: center; flex-wrap: wrap; }

.appicon {
  flex: none;
  width: clamp(96px, 16vw, 148px); aspect-ratio: 1;
  border-radius: 26%;                 /* squircle */
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 20px 50px -12px rgba(109,94,246,.5), inset 0 1px 0 rgba(255,255,255,.4);
  position: relative;
}
.appicon::after { /* glossy top highlight */
  content: ""; position: absolute; inset: 6% 6% 55% 6%;
  border-radius: 30% 30% 60% 60%/40% 40% 100% 100%;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent);
}
.appicon__mark { font-family: var(--f-mono); font-weight: 600; color: #fff; font-size: clamp(1.2rem, 3vw, 1.8rem); letter-spacing: .04em; z-index: 1; }

.hero__id { min-width: 260px; flex: 1; }
.hero__id h1 { font-size: clamp(2.4rem, 7vw, 4.4rem); font-weight: 800; margin: .5rem 0 .3rem; }
.hero__subtitle { font-size: clamp(1rem, 2.4vw, 1.35rem); color: var(--text); font-weight: 600; }
.hero__tagline { color: var(--text-2); margin-top: .7rem; max-width: 46ch; font-size: 1.02rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .7rem 1.3rem; border-radius: 999px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: transform .18s var(--ease), box-shadow .2s, background .2s, border-color .2s;
}
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px -6px rgba(109,94,246,.5); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(109,94,246,.6); }
.btn--ghost { background: var(--pill); color: var(--text); border-color: var(--line-2); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--text-3); }

/* metric strip */
.metrics {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(2rem, 5vw, 3.2rem);
  padding: 1.2rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.metric { text-align: center; padding: 0 .5rem; }
.metric--divide { border-left: 1px solid var(--line); }
.metric dt { font-family: var(--f-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.metric dd { font-family: var(--f-display); font-size: clamp(1.6rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.1; margin: .2rem 0; }
.metric dd span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metric p { font-size: .82rem; color: var(--text-2); }
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 1rem .5rem; }
  .metric--divide:nth-child(3) { border-left: none; }
}

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 2.5rem); }
.section--muted { max-width: none; background: var(--bg-2); }
.section--muted > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section__head { margin-bottom: 2.4rem; }
.section__head h2 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: .5rem 0 .4rem; }
.section__lead { color: var(--text-2); max-width: 56ch; }

/* ---------- App grid ---------- */
.appgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.card {
  text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.1rem; overflow: hidden;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
  display: flex; flex-direction: column; gap: 1rem;
  font: inherit; color: inherit; width: 100%;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 24px 50px -24px rgba(0,0,0,.55); }
.card__cover {
  aspect-ratio: 16/10; border-radius: var(--r-md);
  position: relative; overflow: hidden; display: grid; place-items: center;
  background: var(--cover, var(--grad));
}
.card__cover span { font-family: var(--f-display); font-weight: 800; font-size: 1.5rem; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.35); letter-spacing: -.02em; }
.card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__cover img.missing { display: none; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.card__name { font-family: var(--f-display); font-weight: 700; font-size: 1.12rem; }
.card__open { font-size: .78rem; color: var(--text-3); font-family: var(--f-mono); }
.card__desc { color: var(--text-2); font-size: .9rem; }
.card__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: auto; }
.tag {
  font-family: var(--f-mono); font-size: .7rem; color: var(--text-2);
  padding: .22rem .55rem; border-radius: 999px; background: var(--pill); border: 1px solid var(--line);
}
.tag--enterprise { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 40%, transparent); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl { position: relative; padding: 0 0 2rem 1.4rem; }
.tl:last-child { padding-bottom: 0; }
.tl__dot { position: absolute; left: -1.5rem; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--bg); }
.section--muted .tl__dot { box-shadow: 0 0 0 4px var(--bg-2); }
.tl__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.tl__role { font-family: var(--f-display); font-weight: 700; font-size: 1.12rem; }
.tl__date { font-family: var(--f-mono); font-size: .76rem; color: var(--text-3); }
.tl__co { color: var(--coral); font-weight: 600; font-size: .92rem; margin: .1rem 0 .6rem; }
.tl__co span { color: var(--text-3); font-weight: 400; }
.tl__points { list-style: none; display: grid; gap: .35rem; }
.tl__points li { position: relative; padding-left: 1.1rem; color: var(--text-2); font-size: .93rem; }
.tl__points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.tl__points strong { color: var(--text); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.skillgroup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.2rem; }
.skillgroup h3 { font-size: .8rem; font-family: var(--f-mono); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: .8rem; }
.skillgroup ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.skillgroup li { font-size: .82rem; padding: .3rem .65rem; border-radius: 999px; background: var(--pill); border: 1px solid var(--line); color: var(--text); }

/* ---------- About + wins ---------- */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.about__text h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .5rem 0 1rem; }
.about__text p { color: var(--text-2); margin-bottom: 1rem; max-width: 56ch; }
.about__edu { font-size: .92rem; }
.about__edu span { display: inline-block; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--coral); margin-right: .5rem; }
.wins { list-style: none; display: grid; gap: .7rem; }
.wins li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .8rem 1rem; font-size: .92rem; color: var(--text-2); }
.wins strong { display: inline-block; font-family: var(--f-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.05rem; margin-right: .4rem; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.contact__direct { list-style: none; display: grid; gap: 1rem; }
.contact__direct li { display: grid; gap: .2rem; }
.contact__direct span { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.contact__direct a { font-weight: 600; word-break: break-word; }
.contact__direct a:hover { color: var(--coral); }

.cform { display: grid; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem; }
.cform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field span { font-size: .82rem; color: var(--text-2); font-weight: 500; }
.field input, .field textarea {
  font: inherit; font-size: .95rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: .7rem .8rem; resize: vertical; transition: border-color .2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--coral); }
.cform button { justify-self: start; }
.cform__note { font-size: .88rem; color: var(--coral); min-height: 1.2em; }
@media (max-width: 640px) { .contact__grid { grid-template-columns: 1fr; } .cform__row { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 2.4rem clamp(1rem, 4vw, 2.5rem); }
.footer__inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; }
.footer__mark { font-family: var(--f-mono); font-size: .7rem; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; }
.footer__inner > p { color: var(--text-2); font-size: .92rem; }
.footer__links { display: flex; gap: 1.2rem; margin-left: auto; }
.footer__links a { font-size: .88rem; color: var(--text-2); }
.footer__links a:hover { color: var(--text); }
.footer__fine { width: 100%; color: var(--text-3); font-size: .8rem; font-family: var(--f-mono); }

/* ---------- Modal + phone gallery ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .3s var(--ease); }
.modal__panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(920px, 92vw); max-height: 90vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  padding: 1.6rem; animation: pop .32s var(--ease);
}
.modal__close { position: absolute; right: 1rem; top: 1rem; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--pill); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; z-index: 2; }
.modal__close:hover { background: var(--surface-2); }
.modal__grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(1.2rem, 4vw, 2.4rem); align-items: center; }
@media (max-width: 720px) { .modal__grid { grid-template-columns: 1fr; } }

.modal__eyebrow { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--coral); }
.modal__info h3 { font-size: clamp(1.5rem, 4vw, 2rem); margin: .3rem 0 .6rem; }
.modal__info p { color: var(--text-2); }
.modal__tags { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 1.2rem; }
.modal__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.modal__actions .private { font-family: var(--f-mono); font-size: .78rem; color: var(--text-3); padding: .5rem .9rem; border: 1px dashed var(--line-2); border-radius: 999px; }

/* Phone frame */
.modal__gallery { display: grid; justify-items: center; gap: 1rem; }
.phone {
  position: relative; width: 240px; aspect-ratio: 9/19.5;
  background: #000; border-radius: 40px; padding: 10px;
  box-shadow: 0 0 0 2px var(--line-2), 0 30px 60px -20px rgba(0,0,0,.6);
}
.phone__notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 78px; height: 22px; background: #000; border-radius: 999px; z-index: 3; }
.phone__screen { position: relative; width: 100%; height: 100%; border-radius: 31px; overflow: hidden; background: var(--bg-2); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .35s var(--ease); display: grid; place-items: center; }
.slide.active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide img.missing { display: none; }
.slide__ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; padding: 1rem; background: var(--slide, var(--grad)); color: #fff; }
.slide__ph b { font-family: var(--f-display); font-size: 1.1rem; }
.slide__ph small { font-family: var(--f-mono); font-size: .62rem; opacity: .85; letter-spacing: .04em; }

.gallery__nav { display: flex; align-items: center; gap: 1rem; }
.gnav { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--pill); color: var(--text); font-size: 1.3rem; cursor: pointer; transition: background .2s, transform .2s; }
.gnav:hover { background: var(--surface-2); transform: translateY(-1px); }
.gallery__dots { display: flex; gap: .4rem; }
.gdot { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--line-2); cursor: pointer; padding: 0; }
.gdot.active { background: var(--grad); width: 22px; border-radius: 999px; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__glow, .slide, .modal__scrim, .modal__panel { animation: none !important; }
  .btn, .card, .theme-toggle, .gnav { transition: none !important; }
}

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%,-46%) scale(.97); } }
