/* ===========================================================
   Praharsh Agarwal — iOS-style mobile portfolio
   =========================================================== */

:root {
  --status-h: 47px;
  --nav-h: 44px;
  --dock-h: 94px;
  --home-indicator-h: 34px;

  --ios-bg: #f2f2f7;
  --ios-card: #ffffff;
  --ios-border: rgba(60, 60, 67, 0.29);
  --ios-text: #000000;
  --ios-text-secondary: #6e6e73;
  --ios-blue: #0a84ff;
  --ios-green: #34c759;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Inter", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  color: var(--ios-text);
  -webkit-font-smoothing: antialiased;
  background: #000;
}

button {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

a {
  color: inherit;
}

input,
textarea {
  font-family: inherit;
}

/* ===================== WALLPAPER (shared look w/ desktop site) ===================== */
.wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 50% at 20% 6%, #6f7bd8 0%, rgba(111, 123, 216, 0) 60%),
    radial-gradient(ellipse 80% 45% at 85% 14%, #d68fc9 0%, rgba(214, 143, 201, 0) 55%),
    radial-gradient(ellipse 90% 55% at 15% 96%, #3f8fd1 0%, rgba(63, 143, 209, 0) 55%),
    radial-gradient(ellipse 90% 55% at 92% 100%, #6ecdb8 0%, rgba(110, 205, 184, 0) 55%),
    linear-gradient(165deg, #2b2f6b 0%, #38356f 38%, #4a3c73 62%, #2c3468 100%);
}

/* ===================== LOCK SCREEN ===================== */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  transition: opacity .4s ease, transform .4s ease;
}

.lock-screen.unlocking {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.ls-status {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 16px 20px 0;
  box-sizing: border-box;
}

.ls-center {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: -40px;
}

.ls-time {
  font-size: 76px;
  font-weight: 600;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ls-date {
  font-size: 17px;
  font-weight: 500;
  opacity: .92;
}

.ls-hint {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: 34px;
  opacity: .85;
  font-size: 12.5px;
  font-weight: 500;
  animation: lsBounce 2.2s ease-in-out infinite;
}

@keyframes lsBounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

/* ===================== HOME SCREEN ===================== */
.home-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.status-bar {
  position: relative;
  z-index: 5;
  height: var(--status-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  padding-top: 12px;
  box-sizing: border-box;
  color: #fff;
}

.sb-time {
  font-size: 15.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sb-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.home-scroll {
  position: relative;
  z-index: 2;
  height: calc(100% - var(--status-h) - var(--dock-h) - var(--home-indicator-h));
  overflow-y: auto;
  padding: 14px 18px 6px;
  -webkit-overflow-scrolling: touch;
}

/* ---- Widgets ---- */
.widget-row {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}

.ios-widget {
  flex: 1;
  background: rgba(30, 30, 36, 0.42);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 14px 15px;
  color: #fff;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
}

.widget-clock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1px;
}

.iw-date {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
}

.iw-time {
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.iw-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}

.widget-stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.iw-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.iw-stat-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.iw-num {
  font-size: 14.5px;
  font-weight: 700;
  min-width: 36px;
}

.iw-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
}

/* ---- App grid ---- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 8px;
  margin-bottom: 14px;
}

.app-icon {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #fff;
}

.ai-glyph {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 15px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: transform .15s ease;
}

.app-icon:active .ai-glyph {
  transform: scale(0.9);
}

.app-icon span {
  font-size: 11px;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 0 2px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.dot.active {
  background: #fff;
}

/* ---- Dock ---- */
.dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: var(--home-indicator-h);
  height: calc(var(--dock-h) - var(--home-indicator-h));
  z-index: 4;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 14px;
}

.dock-icon span {
  display: none;
}

.dock-icon .ai-glyph {
  width: 54px;
  height: 54px;
}

.home-indicator {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 6;
  display: flex;
  justify-content: center;
}

.home-indicator::after {
  content: '';
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.9);
}

/* ===================== APP LAYER ===================== */
.app-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.ios-app {
  position: absolute;
  inset: 0;
  background: var(--ios-bg);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .38s cubic-bezier(.32, .72, 0, 1);
  pointer-events: none;
  overflow: hidden;
}

.ios-app.open {
  pointer-events: auto;
  transform: translateY(0);
}

.status-bar-app {
  color: var(--ios-text);
  padding-top: 12px;
  flex-shrink: 0;
}

.status-bar-app .app-time {
  color: var(--ios-text);
}

.nav-bar {
  flex-shrink: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  position: relative;
  background: rgba(242, 242, 247, 0.86);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ios-border);
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--ios-blue);
  font-size: 16px;
  padding: 6px 4px;
  cursor: pointer;
}

.nav-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ios-text);
  pointer-events: none;
  padding: 0 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-spacer {
  width: 60px;
  flex-shrink: 0;
}

.nav-cancel,
.nav-send {
  background: none;
  border: none;
  color: var(--ios-blue);
  font-size: 16px;
  padding: 6px 4px;
  cursor: pointer;
}

.nav-send {
  font-weight: 600;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 32px;
}

/* ---- About ---- */
.about-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 18px;
}

.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  margin-bottom: 6px;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-hero h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.3px;
}

.about-role {
  margin: 0;
  font-size: 14px;
  color: var(--ios-text-secondary);
}

.badge-live {
  margin-top: 4px;
  font-size: 12px;
  color: #1c7a34;
  background: rgba(52, 199, 89, 0.14);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot-live {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ios-green);
}

.about-bio {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ios-text);
  margin: 0 0 12px;
}

.ios-group {
  background: var(--ios-card);
  border-radius: 14px;
  overflow: hidden;
  margin: 14px 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ios-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  font-size: 15px;
  border-bottom: 1px solid var(--ios-border);
}

.ios-row:last-child {
  border-bottom: none;
}

.ir-key {
  color: var(--ios-text-secondary);
}

.ir-val {
  color: var(--ios-text);
  text-align: right;
}

.ir-val a {
  color: var(--ios-blue);
  text-decoration: none;
}

.ios-section-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ios-text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 18px 4px 8px;
}

.ios-section-label:first-child {
  margin-top: 2px;
}

/* ---- Skills ---- */
.skill-lang-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  border-bottom: 1px solid var(--ios-border);
}

.skill-lang-row:last-child {
  border-bottom: none;
}

.skill-lang-name {
  font-size: 15px;
}

.skill-dots {
  display: flex;
  gap: 3px;
}

.skill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ios-border);
}

.skill-dot.filled {
  background: var(--ios-blue);
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.chip {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 20px;
  background: rgba(10, 132, 255, 0.1);
  color: #0064c8;
}

/* ---- Projects list + detail ---- */
.nav-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

.nav-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--ios-bg);
  transform: translateX(100%);
  transition: transform .34s cubic-bezier(.32, .72, 0, 1);
}

.nav-page[data-page="list"] {
  transform: translateX(0);
  z-index: 1;
}

.nav-page[data-page="detail"] {
  z-index: 2;
}

.nav-page[data-page="detail"].pushed {
  transform: translateX(0);
}

.proj-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--ios-border);
  cursor: pointer;
  background: var(--ios-card);
}

.proj-list-row:last-child {
  border-bottom: none;
}

.proj-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.proj-dot.amber {
  background: #ff9f0a;
}

.proj-dot.emerald {
  background: #34c759;
}

.proj-dot.violet {
  background: #af52de;
}

.proj-list-text {
  flex: 1;
  min-width: 0;
}

.proj-list-title {
  font-size: 15.5px;
  font-weight: 500;
}

.proj-list-sub {
  font-size: 12.5px;
  color: var(--ios-text-secondary);
  margin-top: 1px;
}

.proj-chevron {
  color: #c7c7cc;
  flex-shrink: 0;
}

.proj-detail-date {
  font-size: 12.5px;
  color: var(--ios-text-secondary);
  margin-bottom: 4px;
}

.proj-detail-title {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 2px;
}

.proj-detail-sub {
  font-size: 14px;
  color: var(--ios-text-secondary);
  margin: 0 0 14px;
}

.proj-detail-desc {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0 0 16px;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.proj-tag {
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: #444;
  font-family: ui-monospace, monospace;
}

.proj-gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1d1d1f;
  color: #fff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  justify-content: center;
}

/* ---- Education ---- */
.edu-row {
  align-items: flex-start;
  gap: 12px;
}

.edu-logo {
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
  padding: 2px;
}

.edu-logo-div {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.edu-text {
  flex: 1;
}

.edu-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.edu-org {
  font-size: 13px;
  color: var(--ios-text-secondary);
  margin-bottom: 5px;
}

.edu-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ios-text-secondary);
}

.edu-tag {
  background: rgba(52, 199, 89, 0.14);
  color: #1c7a34;
  padding: 2px 9px;
  border-radius: 20px;
}

/* ---- Experience ---- */
.exp-card {
  background: var(--ios-card);
  border-radius: 14px;
  padding: 15px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.exp-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.exp-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.exp-title {
  font-size: 15px;
  font-weight: 600;
}

.exp-org {
  font-size: 12.5px;
  color: var(--ios-text-secondary);
}

.exp-date {
  font-size: 12px;
  color: var(--ios-text-secondary);
  margin-bottom: 8px;
}

.exp-card ul {
  margin: 0;
  padding-left: 18px;
}

.exp-card li {
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 4px;
}

/* ---- Messages (chatbot) ---- */
.msg-nav {
  position: relative;
  justify-content: flex-start;
}

.msg-contact {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  pointer-events: none;
  z-index: 2;
}

.msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 0;
  flex-shrink: 0;
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.msg-contact .nav-title {
  position: static;
  padding: 0;
  margin: 0;
  font-size: 13px;
  line-height: 16px;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}


.msg-content {
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
}

.msg-bubbles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-bubble-row {
  display: flex;
}

.msg-bubble-row.out {
  justify-content: flex-end;
}

.msg-bubble-row.in {
  justify-content: flex-start;
}

.msg-bubble {
  max-width: 78%;
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.35;
}

.msg-bubble-row.out .msg-bubble {
  background: var(--ios-blue);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.msg-bubble-row.in .msg-bubble {
  background: #e9e9eb;
  color: #000;
  border-bottom-left-radius: 5px;
}

.msg-bubble a {
  color: inherit;
  text-decoration: underline;
}

.msg-compose {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(242, 242, 247, 0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--ios-border);
}

.msg-input {
  flex: 1;
  border: 1px solid var(--ios-border);
  border-radius: 20px;
  padding: 9px 15px;
  font-size: 15px;
  outline: none;
  background: #fff;
}

.msg-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ios-blue);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.msg-send:disabled {
  background: #c7c7cc;
}

/* ---- Mail sheet ---- */
.ios-app-sheet {
  border-radius: 16px 16px 0 0;
  top: 44px;
}

.sheet-nav {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.mail-form {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.mail-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ios-border);
  background: var(--ios-card);
  font-size: 15px;
}

.mf-label {
  width: 52px;
  flex-shrink: 0;
  color: var(--ios-text-secondary);
  font-size: 13px;
}

.mf-static {
  color: var(--ios-text);
}

.mail-field input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
}

.mail-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 16px;
  font-size: 15px;
  background: var(--ios-card);
  min-height: 160px;
  margin-top: 10px;
  border-radius: 12px;
}

.form-status {
  padding: 10px 4px;
  font-size: 13px;
  text-align: center;
}

.form-status.success {
  color: #1c7a34;
}

.form-status.error {
  color: #c0392b;
}

/* ---- Resume ---- */
.resume-content {
  flex: 1;
  overflow: hidden;
  background: #6e6e73;
}

.resume-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #fff;
}

.resume-fallback {
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--ios-text-secondary);
  background: #fff;
}

.resume-fallback a {
  color: var(--ios-blue);
}

.nav-open-tab {
  color: var(--ios-blue);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 4px;
}

/* ===================== DARK MODE (follows system) ===================== */
@media (prefers-color-scheme: dark) {
  :root {
    --ios-bg: #000000;
    --ios-card: #1c1c1e;
    --ios-border: rgba(84, 84, 88, 0.6);
    --ios-text: #ffffff;
    --ios-text-secondary: #98989d;
  }

  .nav-bar {
    background: rgba(28, 28, 30, 0.85);
  }

  .msg-compose {
    background: rgba(28, 28, 30, 0.92);
  }

  .msg-input {
    background: #2c2c2e;
    border-color: var(--ios-border);
    color: #fff;
  }

  .msg-bubble-row.in .msg-bubble {
    background: #2c2c2e;
    color: #fff;
  }

  .mail-field,
  .mail-textarea {
    background: #1c1c1e;
  }

  .chip {
    background: rgba(10, 132, 255, 0.18);
    color: #6cb4ff;
  }

  .resume-fallback {
    background: #1c1c1e;
    color: var(--ios-text-secondary);
  }

  .proj-tag {
    background: rgba(255, 255, 255, 0.08);
    color: #ddd;
  }

  .proj-gh-link {
    background: #f2f2f4;
    color: #1d1d1f;
  }

  .proj-list-row {
    background: var(--ios-card);
  }
}

/* Safe-area padding for notch/home-indicator devices */
.status-bar,
.status-bar-app,
.ls-status {
  padding-top: max(12px, env(safe-area-inset-top, 12px));
}

.home-indicator {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ios-blue);
  outline-offset: 2px;
}