/* ============ Design tokens — edit these to reskin the whole site ============ */
:root {
  --ink: #0b0d14;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text-primary: #f3f1ec;
  --text-muted: #9a9cab;
  --accent: #f2b75c;
  --aurora-violet: #6940d1;
  --aurora-teal: #f2b75c;
  --portfolio-card-w: 330px;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 18px;
  --content-width: 760px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--ink);
  color: var(--text-primary);
  font-family: var(--sans);
  line-height: 1.65;
  overflow-x: hidden;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
}
p {
  margin: 0;
}
a {
  color: inherit;
}

/* ============ Ambient background ============ */
.aurora {
  position: fixed;
  top: -100px;
  left: -100px;
  /* Extends beyond the screen by 200px so Samsung Internet's navbar 
     expansion never reveals an unrendered gap */
  width: calc(100vw + 200px);
  height: calc(100lvh + 200px);
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Tell the compositor this layer moves dynamically with viewport scale */
  contain: paint;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
}
.blob-a {
  width: 520px;
  height: 520px;
  background: var(--aurora-violet);
  top: -140px;
  left: -120px;
  animation: drift-a 15s ease-in-out infinite;
}
.blob-b {
  width: 480px;
  height: 480px;
  background: var(--aurora-teal) !important;
  /* Driven by locked pixel coordinate */
  top: var(--blob-b-top, 500px);
  right: -100px;
  animation: drift-b 10s ease-in-out infinite;
  /* Smooth glide if JavaScript updates the variable */
  transition: top 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes drift-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(60px, 80px);
  }
}
@keyframes drift-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-70px, -50px);
  }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 40vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.hero-inner {
  max-width: 620px;
}
.name {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  letter-spacing: -0.02em;
}
.tagline {
  margin-top: 1.1rem;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.hero-actions {
  margin-top: 2.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.btn-primary,
.btn-ghost {
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink);
}
.btn-primary:hover {
  transform: translateY(-2px);
}
.btn-ghost {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:hover {
  border-color: var(--accent);
}

.scroll-cue {
  position: absolute;
  bottom: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.scroll-cue span {
  display: block;
  width: 1px;
  height: 36px;
  background: var(--text-muted);
  animation: pulse-line 1.8s ease-in-out infinite;
}
@keyframes pulse-line {
  0%,
  100% {
    opacity: 0.3;
    transform: scaleY(0.8);
  }
  50% {
    opacity: 1;
    transform: scaleY(1);
  }
}

/* ============ Shared section layout ============ */
.section-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}
h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin-bottom: 2rem;
}

/* ============ Portfolio ============ */
.portfolio-scroll {
  container-type: inline-size;   /* add this line */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 50px,
    black calc(100% - 50px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 50px,
    black calc(100% - 50px),
    transparent 100%
  );
}
.portfolio-scroll::-webkit-scrollbar {
  display: none;
}
.portfolio-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;

  padding-left: calc(50cqw - var(--portfolio-card-w)/2);
  padding-right: calc(50cqw - var(--portfolio-card-w)/2);
}
.project-card {
  flex: 0 0 auto;
  scroll-snap-align: center;
  width: var(--portfolio-card-w);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.project-icon {
  position: absolute;
  top: 20px;
  right: 20px; 
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(242, 183, 92, 0.12);
  color: var(--accent);
}
.project-name {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--text-primary);
}
.project-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============ Links grid ============ */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 1.4rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-decoration: none;
  transition: transform 0.3s ease, border-color 0.3s ease;
}
.link-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}
.link-icon {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--accent);
}
.link-label {
  font-size: 0.92rem;
  color: var(--text-primary);
}

/* ============ About ============ */
.about p {
  max-width: 68ch;
  color: var(--text-muted);
}

/* ============ Education timeline ============ */
.timeline {
  list-style: none;
  margin: 0;
  padding-left: 1.5rem;
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}
.timeline li {
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -1.56rem;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.timeline-body h3 {
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}
.timeline-org {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.timeline-body p:last-child {
  max-width: 60ch;
}

/* ============ Skills ============ */
.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tag-list li {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ============ Footer ============ */
.site-footer {
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============ Scroll-reveal: blur → sharp ============ */
[data-reveal] {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(14px);
  transition: opacity 0.8s ease, filter 0.8s ease, transform 0.8s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* ============ Accessibility: respect reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .blob,
  .scroll-cue span {
    animation: none;
  }
  [data-reveal] {
    transition: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* ============ Mobile ============ */
@media (max-width: 640px) {
  :root {
    --portfolio-card-w: 230px
  }
  .section-inner {
    padding: 3.5rem 1.25rem;
  }
  .blob {
    filter: blur(70px);
  }
  .project-card {
    width: var(--portfolio-card-w);
  }
}

/* Visible keyboard focus */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
