/* ============================================================
   Barani Elangovan — iOS Developer Portfolio
   Plain CSS. Light + dark mode via CSS variables.
   ============================================================ */

/* ----- Color tokens (light mode defaults) ----- */
:root {
  --bg:            #ffffff;
  --bg-alt:        #f5f5f7;
  --text:          #1d1d1f;
  --text-soft:     #515154;
  --accent:        #0071e3;   /* Apple blue */
  --accent-hover:  #0077ed;
  --card-bg:       #ffffff;
  --border:        #e0e0e5;
  --shadow:        0 8px 30px rgba(0, 0, 0, 0.08);
  --radius:        18px;
  --nav-bg:        rgba(255, 255, 255, 0.72);
  --font:          -apple-system, BlinkMacSystemFont, "SF Pro Display",
                   "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ----- Dark mode ----- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #000000;
    --bg-alt:       #111114;
    --text:         #f5f5f7;
    --text-soft:    #a1a1a6;
    --accent:       #2997ff;
    --accent-hover: #47a5ff;
    --card-bg:      #1c1c1e;
    --border:       #2c2c2e;
    --shadow:       0 8px 30px rgba(0, 0, 0, 0.5);
    --nav-bg:       rgba(0, 0, 0, 0.72);
  }
}

/* ----- Base ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- Navigation ----- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
}
.nav__brand span { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav__links a {
  position: relative;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text);
  cursor: pointer;
}

/* ----- Scroll progress bar ----- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 200;
  background: linear-gradient(90deg, var(--accent), #af52de);
  transition: width 0.1s linear;
}

/* ----- Hero ----- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 100px;
  text-align: center;
  background:
    radial-gradient(1200px 400px at 50% -10%,
      rgba(0, 113, 227, 0.10), transparent 70%);
}
.hero__inner { position: relative; z-index: 1; }

/* Animated gradient blobs */
.hero__blobs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  will-change: transform;
}
.blob--1 {
  width: 340px; height: 340px;
  top: -60px; left: 8%;
  background: #0071e3;
  animation: floatBlob 14s ease-in-out infinite;
}
.blob--2 {
  width: 300px; height: 300px;
  top: 40px; right: 6%;
  background: #af52de;
  animation: floatBlob 18s ease-in-out infinite reverse;
}
.blob--3 {
  width: 260px; height: 260px;
  bottom: -80px; left: 42%;
  background: #34c759;
  animation: floatBlob 16s ease-in-out infinite 2s;
}
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -24px) scale(1.08); }
  66%      { transform: translate(-24px, 20px) scale(0.95); }
}
@media (prefers-color-scheme: dark) {
  .blob { opacity: 0.35; }
}
.hero__eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.hero__title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 20px;
}
.hero__lead {
  max-width: 620px;
  margin: 0 auto 34px;
  font-size: 1.15rem;
  color: var(--text-soft);
}
.hero__actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----- Buttons ----- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 13px 26px;
  border-radius: 980px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
/* Sweeping shine on hover */
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn:hover::before { left: 140%; }
.btn:hover { transform: translateY(-2px); }
.btn--primary:hover { box-shadow: 0 10px 24px rgba(0, 113, 227, 0.4); }
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ----- Sections ----- */
.section { padding: 90px 0; }
.section--alt { background: var(--bg-alt); }
.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  text-align: center;
}
.section__text {
  max-width: 680px;
  margin: 0 auto 18px;
  color: var(--text-soft);
  font-size: 1.1rem;
  text-align: center;
}

/* ----- Apps list ----- */
.apps__grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 40px;
}
.card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transform-style: preserve-3d;
  transition: transform 0.2s ease, box-shadow 0.25s ease;
}
.card__body {
  flex: 1;
  min-width: 0;
}
/* Cursor-follow glow (set via JS custom props) */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 0%),
    rgba(0, 113, 227, 0.12),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.card__icon {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transform: translateZ(40px);
  animation: iconFloat 5s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateZ(40px) translateY(0); }
  50%      { transform: translateZ(40px) translateY(-8px); }
}
.card__icon--green  { background: linear-gradient(135deg, #34c759, #30b0c7); }
.card__icon--purple { background: linear-gradient(135deg, #af52de, #5e5ce6); }

/* Real app-icon image filling the rounded tile */
.card__icon--image {
  background: none;
  padding: 0;
  overflow: hidden;
}
.card__icon--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}
.card__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.card__desc {
  color: var(--text-soft);
  margin-bottom: 20px;
}
.card__features {
  list-style: none;
  margin-bottom: 22px;
}
.card__features li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.card__features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.card__features code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin-bottom: 22px;
}
.card__tags li {
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 980px;
  background: var(--bg-alt);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.card__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.card__link:hover { text-decoration: underline; }

.card__soon {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 980px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-alt);
  border: 1px dashed var(--border);
}

/* Row of actions at the bottom of an app card */
.card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.btn--sm {
  padding: 10px 20px;
  font-size: 0.92rem;
}

/* App icon on the Amounta detail page header */
.detail__icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 22px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.detail__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ----- Amounta showcase ----- */
.showcase__eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.shots {
  display: flex;
  flex-direction: column;
  gap: 88px;
  margin-top: 60px;
}
.shot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
/* Alternate image / text sides for rhythm */
.shot:nth-child(even) .shot__media { order: 2; }
.shot__media {
  display: flex;
  justify-content: center;
}
.shot__img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.shot__img:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.28);
}
.shot__eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.shot__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.shot__text {
  color: var(--text-soft);
  font-size: 1.05rem;
}

/* ----- Skills ----- */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  list-style: none;
  margin-top: 34px;
}
.skills li {
  padding: 10px 20px;
  border-radius: 980px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-weight: 500;
  box-shadow: var(--shadow);
  cursor: default;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.skills li:hover {
  transform: translateY(-4px) scale(1.05);
  border-color: var(--accent);
  color: var(--accent);
}

/* ----- Contact ----- */
.contact {
  list-style: none;
  max-width: 480px;
  margin: 34px auto 0;
}
.contact li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.contact__label {
  color: var(--text-soft);
  font-weight: 500;
}
.contact a {
  color: var(--accent);
  text-decoration: none;
}
.contact a:hover { text-decoration: underline; }

/* ----- Footer ----- */
.footer {
  padding: 40px 0;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}
.footer__links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  margin-bottom: 16px;
}
.footer__links a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer__links a:hover { color: var(--accent); }

/* ----- Legal pages (Privacy Policy / Terms) ----- */
.legal {
  padding: 120px 0 80px;
}
.legal__inner {
  max-width: 760px;
}
.legal__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.legal__updated {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 40px;
}
.legal h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
}
.legal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 26px 0 10px;
}
.legal p,
.legal li {
  color: var(--text-soft);
  font-size: 1.02rem;
  margin-bottom: 14px;
}
.legal ul {
  padding-left: 22px;
  margin-bottom: 14px;
}
.legal li { margin-bottom: 8px; }
.legal a {
  color: var(--accent);
  text-decoration: none;
}
.legal a:hover { text-decoration: underline; }
.legal__back {
  display: inline-block;
  margin-top: 44px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.legal__back:hover { text-decoration: underline; }

/* ----- Scroll reveal animation ----- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Respect reduced-motion preference ----- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav__links.open { max-height: 320px; }
  .nav__links li {
    padding: 4px 24px;
    border-top: 1px solid var(--border);
  }
  .nav__links a { display: block; padding: 12px 0; }
  .contact li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .card { flex-direction: column; gap: 18px; padding: 24px; }
}

@media (max-width: 760px) {
  .shots { gap: 60px; }
  .shot {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  /* Keep the image above the text on every row when stacked */
  .shot:nth-child(even) .shot__media { order: 0; }
  .shot__img { max-width: 260px; }
}
