/* =========================================================
   ARYAN MAHATO — PORTFOLIO STYLES
   Sections: 1) Variables  2) Base  3) Nav  4) Hero
             5) Sections/Cards  6) Projects  7) Gallery
             8) Timeline  9) Contact/Footer  10) Animations
            11) Responsive
   ========================================================= */

/* ---------- 1) CSS VARIABLES (theme colors) ---------- */
:root {
  /* Yellow background theme (default) */
  --bg: #fde047;
  --bg-alt: #fde68a;
  --surface: rgba(255, 255, 255, 0.45);
  --surface-solid: #fffbeb;
  --border: rgba(24, 24, 27, 0.14);
  --text: #18181b;
  --text-muted: #3f3f46;
  --accent: #0f172a;
  --accent-2: #1d4ed8;
  --accent-soft: rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 30px rgba(24, 24, 27, 0.18);
  --btn-on-accent: #fde047;
  --hero-glow-1: rgba(29, 78, 216, 0.12);
  --hero-glow-2: rgba(15, 23, 42, 0.1);
  --radius: 16px;
  --nav-h: 68px;
  --font: "Poppins", system-ui, sans-serif;
  --mono: "Fira Code", monospace;
}

/* Dark mode (toggled by adding .dark-theme on <html>) */
html.dark-theme {
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-solid: #111c33;
  --border: rgba(148, 163, 184, 0.16);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #38bdf8;
  --accent-soft: rgba(34, 211, 238, 0.12);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --btn-on-accent: #04121c;
  --hero-glow-1: rgba(34, 211, 238, 0.12);
  --hero-glow-2: rgba(56, 189, 248, 0.1);
}

/* ---------- 2) BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

.container--narrow {
  width: min(760px, 92%);
}

.section {
  padding: 90px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  text-align: center;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
}

.section__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.section__subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 45px;
  font-size: 0.98rem;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--btn-on-accent);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}

.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.38);
}

.btn--ghost {
  border-color: var(--border);
  background: var(--surface);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--small {
  padding: 9px 18px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: var(--surface);
}

.btn--small:hover {
  background: var(--accent);
  color: var(--btn-on-accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.btn--lg {
  padding: 15px 36px;
  font-size: 1.05rem;
}

/* ---------- 3) NAVIGATION ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Frosted glass only once the user scrolls */
.navbar.scrolled {
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.nav__logo-bracket {
  color: var(--accent);
}

.nav__menu {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav__link {
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 8px;
  position: relative;
  transition: color 0.25s ease, background 0.25s ease;
}

.nav__link:hover {
  color: var(--text);
}

/* Active navigation indicator */
.nav__link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.3s ease, border-color 0.25s ease;
}

.theme-toggle:hover {
  transform: rotate(-25deg) scale(1.08);
  border-color: var(--accent);
}

/* Hamburger (hidden on desktop) */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}

.nav__burger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__burger.open span:nth-child(2) {
  opacity: 0;
}

.nav__burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 4) HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 80% 20%, var(--hero-glow-1), transparent 70%),
    radial-gradient(50% 40% at 15% 85%, var(--hero-glow-2), transparent 70%);
}

.hero__particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 50px;
  position: relative;
  z-index: 2;
}

.hero__hello {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 10px;
}

.hero__title {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  line-height: 1.15;
  font-weight: 700;
  background: linear-gradient(120deg, var(--text) 30%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__wave {
  display: inline-block;
  animation: wave 2.4s ease-in-out infinite;
  transform-origin: 70% 70%;
  -webkit-text-fill-color: initial;
}

.hero__subtitle {
  margin-top: 14px;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  color: var(--text-muted);
}

.hero__subtitle .dot {
  color: var(--accent);
  margin: 0 4px;
}

.hero__intro {
  margin-top: 18px;
  max-width: 520px;
  color: var(--text-muted);
}

.hero__buttons {
  display: flex;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  animation: bounce 1.8s infinite;
  z-index: 2;
}

/* Code window visual */
.code-window {
  background: rgba(9, 15, 30, 0.75);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.code-window__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
}

.code-window__bar span[class^="dot-"] {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.code-window__file {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: #94a3b8;
}

.code-window__body {
  padding: 20px;
  font-family: var(--mono);
  font-size: clamp(0.72rem, 1.6vw, 0.9rem);
  line-height: 1.75;
  color: #e2e8f0;
  overflow-x: auto;
}

.c-key { color: #c084fc; }
.c-var { color: #67e8f9; }
.c-prop { color: #7dd3fc; }
.c-str { color: #86efac; }
.c-num { color: #fbbf24; }
.c-fn { color: #f472b6; }

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

/* ---------- 5) ABOUT ---------- */
.about {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 45px;
  align-items: center;
}

.about__avatar-circle {
  width: 220px;
  height: 220px;
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 3rem;
  font-weight: 700;
  color: var(--btn-on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  position: relative;
  box-shadow: 0 0 0 8px var(--accent-soft), var(--shadow);
}

/* Profile photo (assets/images/aryan.jpg) */
.about__avatar-circle img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 50%;
}

/* Fallback initials if the photo is missing */
.about__initials {
  display: none;
}

.about__avatar-circle::before {
  content: "";
  position: absolute;
  inset: -18px;
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  animation: spin 22s linear infinite;
}

.about__quote {
  font-size: 1.1rem;
  color: var(--text);
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  margin-bottom: 26px;
}

.about__facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.about__facts li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  min-width: 130px;
}

.about__fact-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
}

.about__fact-value {
  font-weight: 500;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.card__icon {
  font-size: 1.9rem;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border-radius: 14px;
  margin-bottom: 16px;
  transition: transform 0.3s ease;
}

.card:hover .card__icon {
  transform: scale(1.1) rotate(-6deg);
}

.card__title {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card__text {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  margin: 0 6px 6px 0;
}

/* ---------- 6) PROJECTS ---------- */
.project {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.project:hover {
  transform: translateY(-8px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: var(--shadow);
}

.project__thumb {
  height: 150px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 1.3rem;
  color: #e0f7ff;
  letter-spacing: 2px;
  text-transform: lowercase;
}

.project__thumb--1 { background: linear-gradient(135deg, #0e7490, #164e63); }
.project__thumb--2 { background: linear-gradient(135deg, #0369a1, #0c4a6e); }
.project__thumb--3 { background: linear-gradient(135deg, #1e40af, #1e3a8a); }
.project__thumb--4 { background: linear-gradient(135deg, #3730a3, #312e81); }

.project__body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.project__title {
  font-size: 1.15rem;
}

.project__text {
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}

.project__tags {
  margin: 4px 0 8px;
}

/* ---------- 7) GALLERY (Creative Corner) ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 200px;
  gap: 18px;
}

.gallery__item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.gallery__item--tall {
  grid-row: span 2;
}

.gallery__item--wide {
  grid-column: span 2;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery__item:hover img {
  transform: scale(1.07);
}

.gallery__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 26px 14px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  background: linear-gradient(transparent, rgba(3, 10, 22, 0.85));
  color: #e2e8f0;
  transform: translateY(6px);
  opacity: 0.9;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery__item:hover .gallery__caption {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- 8) TIMELINE ---------- */
.timeline {
  list-style: none;
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding-left: 0;
}

/* Vertical line */
.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  opacity: 0.5;
}

.timeline__item {
  position: relative;
  padding: 0 0 34px 44px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  transition: transform 0.3s ease;
}

.timeline__item:hover .timeline__dot {
  transform: scale(1.25);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.timeline__content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.timeline__item:hover .timeline__content {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  transform: translateX(6px);
}

.timeline__step {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.timeline__content h3 {
  font-size: 1.05rem;
  margin: 4px 0 4px;
}

.timeline__content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline__item--future .timeline__dot {
  border-style: dashed;
  background: var(--accent);
}

/* ---------- 9) CONTACT & FOOTER ---------- */
.contact {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 46px 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.contact__cta {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 22px;
}

.contact__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  border-radius: 12px;
  margin-bottom: 10px;
  transition: background 0.25s ease, transform 0.25s ease;
}

a.contact__item:hover {
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.contact__socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 22px 0;
}

.social {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.social:hover {
  color: var(--btn-on-accent);
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
}

/* ---------- 9) FOOTER + BACK TO TOP ---------- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 26px 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.footer__note {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--btn-on-accent);
}

/* ---------- 10) ANIMATIONS ---------- */
/* Scroll reveal — hidden until JS adds .visible */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(4deg); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

/* ---------- 11) RESPONSIVE ---------- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero__intro { margin-inline: auto; }
  .hero__buttons { justify-content: center; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; text-align: center; }
  .about__quote { text-align: left; }
  .about__facts { justify-content: center; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav__menu {
    position: fixed;
    top: var(--nav-h);
    right: -100%;
    width: min(300px, 80vw);
    height: calc(100vh - var(--nav-h));
    flex-direction: column;
    gap: 4px;
    background: var(--surface-solid);
    border-left: 1px solid var(--border);
    padding: 22px 18px;
    transition: right 0.35s ease;
    box-shadow: var(--shadow);
  }

  .nav__menu.open { right: 0; }
  .nav__link { display: block; padding: 12px 14px; font-size: 1rem; }
  .nav__burger { display: flex; }
  .section { padding: 70px 0; }
}

@media (max-width: 560px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; grid-auto-rows: 220px; }
  .gallery__item--tall, .gallery__item--wide { grid-column: auto; grid-row: auto; }
  .footer__inner { flex-direction: column; }
  .hero { padding-top: calc(var(--nav-h) + 20px); }
}
