/* ==============================================
   KINTSUGI — Akhil Chintalapati
   ============================================== */

:root {
  --bg:          #07070f;
  --ceramic:     #0e0e1e;
  --gold:        #D4AF37;
  --gold-lt:     #F0C84A;
  --gold-dk:     #8B6500;
  --gold-glow:   rgba(212, 175, 55, 0.35);
  --gold-glow2:  rgba(212, 175, 55, 0.12);
  --cream:       #EDE5D0;
  --cream-dim:   #B8AD9A;
  --text:        #C8C0B0;
  --text-dim:    #706860;
  --gap:         5rem;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
}

/* grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9998;
  opacity: 0.4;
}

/* ── Canvas ── */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Cursor glow ── */
#cursor-glow {
  position: fixed;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0.06) 0%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* ==============================================
   HERO
   ============================================== */

#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem 3rem;
  position: relative;
  z-index: 2;
}

/* Bowl */
.bowl-wrap {
  width: min(420px, 80vw);
  position: relative;
  filter: drop-shadow(0 0 48px rgba(212,175,55,0.12))
          drop-shadow(0 20px 60px rgba(0,0,0,0.8));
  animation: bowl-float 7s ease-in-out infinite;
}

@keyframes bowl-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  30%       { transform: translateY(-10px) rotate(0.3deg); }
  70%       { transform: translateY(-6px) rotate(-0.2deg); }
}

#bowl-svg { width: 100%; height: auto; overflow: visible; }

/* Crack draw animation */
.crack {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw-crack 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards,
             gold-pulse 5s ease-in-out 2s infinite;
}
.crack-shadow {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
  animation: draw-crack 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0.5;
}
.crack-sm {
  stroke-dasharray: 700;
  stroke-dashoffset: 700;
}

/* Stagger — shadow draws first, then gold segments fade in */
#c1-shadow { animation-delay: 0.3s; }
#c1        { animation-delay: 0.4s; }
#c2-shadow { animation-delay: 0.7s; }
#c2        { animation-delay: 0.8s; }
#c3-shadow { animation-delay: 1.0s; }
#c3        { animation-delay: 1.1s; }
#c4-shadow { animation-delay: 1.3s; }
#c4        { animation-delay: 1.4s; }
#c5-shadow { animation-delay: 1.6s; }
#c5        { animation-delay: 1.7s; }
#c6-shadow { animation-delay: 1.9s; }
#c6        { animation-delay: 2.0s; }

@keyframes draw-crack {
  to { stroke-dashoffset: 0; }
}

@keyframes gold-pulse {
  0%, 100% { filter: brightness(1) drop-shadow(0 0 4px rgba(212,175,55,0.4)); }
  50%       { filter: brightness(1.35) drop-shadow(0 0 10px rgba(240,200,74,0.7)); }
}

/* Crack group hover */
.crack-group {
  cursor: pointer;
}
.crack-group:hover .crack-segs {
  filter: brightness(1.55) drop-shadow(0 0 12px rgba(240,200,74,0.85));
}
.crack-group:hover .crack-shadow { opacity: 0.9; }

/* Segmented gold — fade in after shadow draws */
.crack-segs {
  opacity: 0;
  animation: seg-appear 0.7s ease forwards;
}
@keyframes seg-appear { to { opacity: 1; } }

.crack-group[data-section="tesla"]    .crack-segs { animation-delay: 0.6s; }
#c1b-group                                         { animation-delay: 1.1s; }
.crack-group[data-section="duke"]     .crack-segs { animation-delay: 1.0s; }
.crack-group[data-section="samsung"]  .crack-segs { animation-delay: 1.3s; }
.crack-group[data-section="hpcl"]     .crack-segs { animation-delay: 1.6s; }
.crack-group[data-section="research"] .crack-segs { animation-delay: 1.9s; }
.crack-group[data-section="projects"] .crack-segs { animation-delay: 2.2s; }

/* Hero text */
.hero-text {
  text-align: center;
  margin-top: 2.8rem;
  position: relative;
  z-index: 2;
}

.hero-name {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  color: var(--cream);
  letter-spacing: 0.14em;
  animation: fade-up 1s ease 2.4s both;
}

.hero-rule {
  height: 1px;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  box-shadow: 0 0 10px var(--gold-glow);
  margin: 0.8rem auto;
  animation: rule-grow 1.4s ease 2.8s both;
}

@keyframes rule-grow {
  to { width: 55%; }
}

.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  color: var(--gold);
  line-height: 1.55;
  margin-top: 1rem;
  opacity: 0.92;
  animation: fade-up 1s ease 3.1s both;
}

.hero-role {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 1rem;
  animation: fade-up 1s ease 3.4s both;
}

.hero-resume-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--cream-dim);
  margin-top: 2rem;
  animation: fade-up 1s ease 3.8s both;
}

.resume-dl {
  display: inline-block;
  margin-top: 0.7rem;
  padding: 0.45rem 1.2rem;
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid rgba(212,175,55,0.45);
  background: rgba(212,175,55,0.06);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease,
              box-shadow 0.3s ease;
}

.resume-dl:hover {
  background: rgba(212,175,55,0.13);
  border-color: var(--gold);
  color: var(--gold-lt);
  box-shadow: 0 0 18px rgba(212,175,55,0.2);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll cue */
.scroll-cue {
  margin-top: auto;
  padding-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: fade-up 1s ease 4s both;
}

.scroll-label {
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-dk);
}

.scroll-chevrons {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.scroll-chevrons span {
  display: block;
  width: 14px;
  height: 14px;
  border-right: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  transform: rotate(45deg);
  animation: chevron-fall 1.5s ease-in-out infinite;
  opacity: 0;
}
.scroll-chevrons span:nth-child(1) { animation-delay: 0s; }
.scroll-chevrons span:nth-child(2) { animation-delay: 0.2s; }
.scroll-chevrons span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chevron-fall {
  0%   { opacity: 0; transform: rotate(45deg) translate(-4px, -4px); }
  50%  { opacity: 0.8; }
  100% { opacity: 0; transform: rotate(45deg) translate(4px, 4px); }
}

/* ==============================================
   PHILOSOPHY
   ============================================== */

#philosophy {
  padding: 3rem 2rem 2rem;
  max-width: 780px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.philosophy-inner {
  position: relative;
  padding-left: 3rem;
}

.phi-crack {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--gold), var(--gold-dk) 80%, transparent);
  box-shadow: 0 0 10px var(--gold-glow);
}

.phi-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--cream-dim);
  line-height: 1.95;
  margin-bottom: 1.6rem;
}

.phi-text--em {
  font-style: italic;
  color: var(--cream);
  font-size: clamp(1.15rem, 2.8vw, 1.5rem);
}

.phi-text--small {
  font-style: italic;
  color: var(--gold);
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  margin-bottom: 0;
}

/* ==============================================
   STORY SECTIONS
   ============================================== */

.story {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0 3.5rem;
  max-width: 960px;
  margin: 0 auto;
  padding: var(--gap) clamp(1.5rem, 4vw, 3rem);
  position: relative;
  z-index: 2;
}

.story--flip {
  grid-template-columns: 1fr 64px;
}
.story--flip .story-marker { order: 2; }
.story--flip .story-content { order: 1; }

/* Separator line between stories */
.story::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 4rem;
  background: linear-gradient(to bottom, transparent, rgba(212,175,55,0.25));
}

.story-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.4rem;
}

.marker-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--gold);
  opacity: 0.35;
  line-height: 1;
  text-shadow: 0 0 20px var(--gold-glow);
  transition: opacity 0.4s ease;
}

.story:hover .marker-num { opacity: 0.7; }

.marker-vline {
  flex: 1;
  width: 1px;
  margin-top: 1rem;
  background: linear-gradient(to bottom, var(--gold-dk), transparent);
  box-shadow: 0 0 6px var(--gold-glow2);
}

.story-content { padding: 0.4rem 0; }

.story-label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
  margin-bottom: 1.2rem;
}

.story-h {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 2rem;
}

.story-h em {
  font-style: italic;
  color: var(--gold);
  display: block;
}

.story-p {
  font-size: clamp(0.9rem, 1.8vw, 0.97rem);
  color: var(--text);
  line-height: 1.85;
  max-width: 600px;
  margin-bottom: 0.9rem;
}

.story-p em {
  color: var(--gold);
  font-style: italic;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.8rem;
  margin-top: 2.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212,175,55,0.12);
}

.meta-co {
  font-family: 'Playfair Display', serif;
  font-size: 0.92rem;
  color: var(--gold);
}

.meta-role {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.meta-yr {
  font-size: 0.78rem;
  color: var(--gold-dk);
  margin-left: auto;
}

/* ==============================================
   SKILLS — shards
   ============================================== */

#skills {
  padding: var(--gap) clamp(1.5rem, 4vw, 3rem);
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.skills-label {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--gold);
  opacity: 0.7;
  text-align: center;
  margin-bottom: 3rem;
}

.shards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.shard {
  padding: 1.1rem 1.6rem;
  font-size: 0.82rem;
  color: var(--cream-dim);
  letter-spacing: 0.04em;
  line-height: 1.7;
  background: linear-gradient(135deg,
    rgba(212,175,55,0.055) 0%,
    rgba(212,175,55,0.02) 100%);
  border: 1px solid rgba(212,175,55,0.14);
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  position: relative;
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.shard::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.shard:hover {
  background: linear-gradient(135deg,
    rgba(212,175,55,0.11) 0%,
    rgba(212,175,55,0.05) 100%);
  border-color: rgba(212,175,55,0.3);
  color: var(--cream);
}

.shard:hover::after { opacity: 1; }

/* ==============================================
   CONTACT
   ============================================== */

#contact {
  padding: var(--gap) 2rem 7rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.contact-vline {
  width: 1px;
  height: 6rem;
  background: linear-gradient(to bottom, transparent, var(--gold));
  box-shadow: 0 0 12px var(--gold-glow);
  margin: 0 auto 4rem;
}

.contact-inner { max-width: 580px; margin: 0 auto; }

/* Seal */
.seal {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 3.5rem;
}

.seal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  animation: seal-pulse 4.5s ease-in-out infinite;
}

.seal-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 0.5px solid rgba(212,175,55,0.3);
}

@keyframes seal-pulse {
  0%, 100% { box-shadow: 0 0 18px var(--gold-glow), inset 0 0 18px rgba(212,175,55,0.04); }
  50%       { box-shadow: 0 0 40px rgba(212,175,55,0.5), inset 0 0 28px rgba(212,175,55,0.1); }
}

.seal-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.contact-h {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  color: var(--cream);
  line-height: 1.3;
  margin-bottom: 2.8rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.03);
  font-size: 0.88rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.contact-link::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  transition: left 0.5s ease;
}

.contact-link .link-icon {
  width: 20px;
  height: 20px;
  color: var(--gold);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.contact-link span {
  position: relative;
  z-index: 1;
}

/* Email link */
.email-link:hover {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

.email-link:hover::before { left: 100%; }
.email-link:hover .link-icon { transform: scale(1.1) rotate(-10deg); }

/* LinkedIn link */
.linkedin-link:hover {
  border-color: rgba(240, 200, 74, 0.5);
  background: rgba(240, 200, 74, 0.08);
  box-shadow: 0 0 20px rgba(240, 200, 74, 0.2);
  transform: translateY(-2px);
}

.linkedin-link:hover::before { left: 100%; }
.linkedin-link:hover .link-icon { 
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 0 4px rgba(240, 200, 74, 0.6));
}

/* GitHub link */
.github-link:hover {
  border-color: rgba(245, 208, 96, 0.5);
  background: rgba(245, 208, 96, 0.08);
  box-shadow: 0 0 20px rgba(245, 208, 96, 0.2);
  transform: translateY(-2px);
}

.github-link:hover::before { left: 100%; }
.github-link:hover .link-icon { 
  transform: scale(1.1);
  animation: github-spin 0.6s ease-in-out;
}

@keyframes github-spin {
  0%, 100% { transform: scale(1.1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(360deg); }
}

/* Phone link */
.phone-link {
  cursor: default;
  border-color: rgba(180, 140, 30, 0.15);
  background: rgba(180, 140, 30, 0.02);
}

.phone-link span { color: var(--text-dim); }
.phone-link .link-icon { color: var(--text-dim); opacity: 0.6; }

/* Responsive */
@media (max-width: 650px) {
  .contact-link { font-size: 0.82rem; padding: 0.65rem 1rem; }
  .contact-link .link-icon { width: 18px; height: 18px; }
}

.kintsugi-note {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ==============================================
   SCROLL REVEAL
   ============================================== */

.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.95s ease, transform 0.95s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==============================================
   RESPONSIVE
   ============================================== */

@media (max-width: 680px) {
  :root { --gap: 6rem; }

  .story,
  .story--flip {
    grid-template-columns: 1fr;
    gap: 1.5rem 0;
  }

  .story--flip .story-marker,
  .story--flip .story-content { order: unset; }

  .story-marker {
    flex-direction: row;
    align-items: center;
    gap: 1.2rem;
    padding-top: 0;
  }

  .marker-vline {
    flex: 0;
    width: 48px;
    height: 1px;
    margin-top: 0;
    background: linear-gradient(to right, var(--gold-dk), transparent);
  }

  .story-h { font-size: 1.7rem; }

  .story-meta { flex-direction: column; gap: 0.3rem; }
  .meta-yr { margin-left: 0; }
}
