/* Tharindu Prabashwara — personal landing page (builds on /styles.css) */

/* ---------- hero ---------- */
.thero { position: relative; min-height: 100svh; padding: 110px 24px 80px; display: grid; align-items: center; overflow: hidden; isolation: isolate; }
.spot { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(520px circle at var(--sx, 70%) var(--sy, 40%), rgba(145, 94, 255, .22), transparent 60%); transition: background .2s; }
.giant { position: absolute; inset: 0; z-index: -1; display: grid; align-content: center; gap: 0; pointer-events: none; overflow: hidden; }
.giant__row { display: block; white-space: nowrap; font-weight: 900; font-size: clamp(5rem, 17vw, 15rem); line-height: .86; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .08); transform: translateX(var(--gx, 0px)); will-change: transform; }
.giant__row:first-child { margin-left: -4vw; }
.giant__row--fill { -webkit-text-stroke: 0; background: linear-gradient(90deg, rgba(145,94,255,.13), rgba(255,79,163,.1)); -webkit-background-clip: text; background-clip: text; margin-left: -18vw; }

.thero__inner { width: min(1180px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.05fr .95fr; gap: 30px; align-items: center; }
.award { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; font-weight: 600; font-size: .9rem; background: linear-gradient(90deg, rgba(255, 210, 63, .18), rgba(255, 210, 63, .04)); border: 1px solid rgba(255, 210, 63, .4); color: #ffe48a; }
.award__icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 210, 63, .2); animation: trophy 3s ease-in-out infinite; }
@keyframes trophy { 0%, 100% { transform: rotate(0) scale(1); } 10% { transform: rotate(-14deg) scale(1.15); } 20% { transform: rotate(10deg) scale(1.1); } 30% { transform: none; } }
.thero__title { margin: 22px 0 12px; font-size: clamp(2.8rem, 7.4vw, 6rem); font-weight: 900; line-height: .95; letter-spacing: -.045em; display: grid; }
.thero__hi { font-size: .62em; color: var(--muted); letter-spacing: -.03em; }
.thero .hero__rotator { margin-top: 4px; }
.socials { display: flex; gap: 10px; margin-top: 26px; }
.soc { --mx: 0px; --my: 0px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); transform: translate(var(--mx), var(--my)); transition: transform .35s var(--ease), background .3s, border-color .3s; }
.soc svg { width: 20px; height: 20px; fill: #fff; }
.soc:hover { background: var(--brand); border-color: var(--brand); }
.soc--wa:hover { background: #25d366; border-color: #25d366; }

/* stage with orbiting tools */
.stage { position: relative; aspect-ratio: 1 / 1.08; width: min(100%, 560px); justify-self: center; display: grid; place-items: end center; }
.stage__glow { position: absolute; left: 50%; top: 46%; width: 78%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: conic-gradient(from var(--spin), var(--brand), var(--cyan), var(--magenta), var(--yellow), var(--brand)); filter: blur(60px); opacity: .45; animation: spin 12s linear infinite; }
.orbit { position: absolute; left: 50%; top: 46%; aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .16); transform: translate(-50%, -50%) rotate(0deg); animation: orbit 34s linear infinite; }
.orbit--outer { width: 96%; }
.orbit--inner { width: 66%; animation-duration: 22s; animation-direction: reverse; border-style: solid; border-color: rgba(145, 94, 255, .22); }
@keyframes orbit { to { transform: translate(-50%, -50%) rotate(360deg); } }
/* each item sits at the ring centre, is rotated to its angle, then pushed out by half the ring width */
.orbit { container-type: inline-size; }
.orb { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateY(-50cqw); }
.tool { display: grid; place-items: center; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 13px; font-style: normal; font-weight: 800; font-size: .95rem; letter-spacing: -.02em; box-shadow: 0 12px 30px -10px rgba(0,0,0,.8), inset 0 0 0 2px rgba(255,255,255,.08); }
.orbit .tool { animation: counter 34s linear infinite; transform: rotate(calc(-1 * var(--a))); }
@keyframes counter { from { rotate: 0deg; } to { rotate: -360deg; } }
.t-ps { background: #001e36; color: #31a8ff; } .t-ai { background: #330000; color: #ff9a00; } .t-ae { background: #00005b; color: #9999ff; } .t-pr { background: #00005b; color: #ea77ff; }
.t-fg { background: #1e1e1e; color: #a259ff; } .t-bl { background: #1b2a3a; color: #f5792a; } .t-c4 { background: #11131a; color: #3b7cff; font-size: .7rem; } .t-dr { background: #222; color: #ffb35c; font-size: .8rem; }
.t-sk { background: #2b2100; color: #fdb300; } .t-pc { background: #111; color: #e8e8e8; } .t-id { background: #49021f; color: #ff3366; } .t-lr { background: #001a33; color: #31a8ff; }
.spark { display: block; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 18px var(--c), 0 0 4px #fff; }
.stage__me { position: relative; z-index: 2; width: 74%; height: auto; filter: drop-shadow(0 30px 50px rgba(0,0,0,.6)); animation: rise 1.2s var(--ease) .5s both; -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
.tag { --tx: 0px; --ty: 0px; position: absolute; z-index: 3; display: grid; gap: 1px; padding: 10px 14px; border-radius: 14px; background: rgba(14, 11, 40, .78); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 20px 40px -20px rgba(0,0,0,.8); font-size: .82rem; translate: var(--tx) var(--ty); transition: translate .6s var(--ease); }
.tag .mono { font-size: .66rem; color: var(--muted); }
.tag--a { left: 0; top: 22%; animation: bob 6s ease-in-out infinite; border-color: rgba(145,94,255,.5); }
.tag--b { right: -2%; top: 48%; animation: bob 7s ease-in-out -2s infinite; }
.tag--c { left: 6%; bottom: 14%; animation: bob 8s ease-in-out -4s infinite; }

/* scramble headings keep their width while decoding */
[data-scramble] { font-variant-ligatures: none; }
.scr { color: var(--cyan); }

/* ---------- about ---------- */
.about2 { display: grid; grid-template-columns: .8fr 1.2fr; gap: 50px; align-items: start; }
.portrait { --rx: 0deg; --ry: 0deg; position: relative; margin: 0; border-radius: 26px; overflow: visible; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .4s var(--ease); }
.portrait img { width: 100%; height: auto; border-radius: 26px; display: block; box-shadow: 0 40px 80px -30px rgba(145,94,255,.6); }
.portrait figcaption { position: absolute; left: 16px; bottom: 16px; font-size: .72rem; padding: 6px 12px; border-radius: 999px; background: rgba(7,6,21,.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.portrait__frame { position: absolute; inset: -14px 14px 14px -14px; z-index: -1; border-radius: 30px; border: 2px solid var(--brand); opacity: .7; }
.portrait.reveal.in { transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); }
.about2__text { display: grid; gap: 16px; }
.about2__text p { color: #d5d2ee; font-size: 1.02rem; }
.lead { font-size: clamp(1.5rem, 3vw, 2.2rem) !important; font-weight: 800; line-height: 1.15; color: var(--text) !important; letter-spacing: -.02em; }

.idcard { margin-top: 10px; width: min(380px, 100%); aspect-ratio: 1.6; padding: 0; border: 0; background: none; cursor: pointer; perspective: 1000px; color: var(--text); text-align: left; }
.idcard__inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--ease); }
.idcard.is-flipped .idcard__inner, .idcard:hover .idcard__inner { transform: rotateY(180deg); }
.idcard__face { position: absolute; inset: 0; border-radius: 20px; padding: 20px 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 1px solid rgba(255,255,255,.14); overflow: hidden; }
.idcard__front { display: grid; align-content: space-between; background: radial-gradient(400px circle at 100% 0%, rgba(255,79,163,.45), transparent 55%), linear-gradient(135deg, #6d3df5, #2a1670); }
.idcard__front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.25) 50%, transparent 65%); transform: translateX(-120%); animation: sheenLoop 4s ease-in-out infinite; }
@keyframes sheenLoop { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.idcard__front img { border-radius: 12px; }
.idcard__name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.idcard__role { font-size: .72rem; opacity: .85; }
.idcard__hint { position: absolute; right: 18px; top: 22px; font-size: .66rem; opacity: .7; }
.idcard__back { transform: rotateY(180deg); background: #0f0c2a; display: grid; align-content: center; gap: 8px; }
.idrow { display: grid; font-size: .9rem; font-weight: 600; }
.idrow small { font-size: .62rem; color: var(--brand2); text-transform: uppercase; font-weight: 400; }

/* ---------- journey timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0 0 0 0; position: relative; display: grid; gap: 22px; }
.tl::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--line); }
.tl::after { content: ""; position: absolute; left: 50%; top: 0; width: 2px; margin-left: -1px; height: calc(var(--p, 0) * 100%); background: linear-gradient(var(--brand), var(--cyan), var(--magenta), var(--yellow)); box-shadow: 0 0 14px rgba(145,94,255,.8); }
.tl__item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 70px; }
.tl__item:nth-child(odd) .tl__card { grid-column: 1; text-align: right; }
.tl__item:nth-child(even) .tl__card { grid-column: 2; }
.tl__dot { position: absolute; left: 50%; top: 22px; z-index: 1; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--bg); border: 3px solid var(--brand); box-shadow: 0 0 0 6px var(--bg); display: grid; place-items: center; font-size: .9rem; transition: background .4s, transform .4s var(--ease); }
.tl__item.in .tl__dot { background: var(--brand); transform: scale(1.15); }
.tl__item--star .tl__dot { width: 44px; height: 44px; margin-left: -22px; top: 10px; border-color: var(--yellow); background: rgba(255,210,63,.15); }
.tl__item--now .tl__dot { border-color: #3ef08b; }
.tl__card { padding: 20px 22px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); transition: border-color .3s, transform .4s var(--ease); }
.tl__card:hover { border-color: rgba(145,94,255,.5); transform: translateY(-4px); }
.tl__item--star .tl__card { background: linear-gradient(135deg, rgba(255,210,63,.16), rgba(255,210,63,.03)); border-color: rgba(255,210,63,.4); }
.tl__tag { font-size: .7rem; color: var(--brand2); text-transform: uppercase; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 8px; }
.tl__card h3 { font-size: 1.15rem; }
.tl__card p:not(.tl__tag) { color: var(--muted); font-size: .94rem; margin-top: 6px; }
.tl__item.reveal:not(.in) { transform: translateY(40px); }
.tl__item:nth-child(odd).reveal:not(.in) .tl__card { transform: translateX(-30px); }
.tl__item:nth-child(even).reveal:not(.in) .tl__card { transform: translateX(30px); }

/* ---------- skills ---------- */
.skillsets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.skillset { --rx: 0deg; --ry: 0deg; padding: 24px 20px; border-radius: 22px; background: var(--panel); border: 1px solid var(--line); transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .4s var(--ease), border-color .3s, opacity .9s var(--ease); position: relative; overflow: hidden; }
.skillset::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); box-shadow: 0 0 20px var(--accent); }
.skillset:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.skillset h3 { font-size: 1.2rem; margin-bottom: 16px; }
.skillset ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.skillset li { display: flex; align-items: center; gap: 12px; font-size: .92rem; font-weight: 500; }
.ring { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 7; }
.ring .ring__bar { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 213.6; stroke-dashoffset: 213.6; transition: stroke-dashoffset 1.6s var(--ease); filter: drop-shadow(0 0 4px var(--accent)); }
.ring__n { position: relative; font-size: .74rem; font-weight: 700; }
.ring__n::after { content: "%"; font-size: .6rem; opacity: .7; }
.tools__title { margin: 56px 0 18px; }
.tools { display: grid; gap: 12px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.tools__row { display: flex; gap: 12px; width: max-content; animation: marquee 34s linear infinite; }
.tools__row--rev { animation-direction: reverse; animation-duration: 40s; }
.tools:hover .tools__row { animation-play-state: paused; }
.tchip { display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; transition: transform .3s var(--ease), border-color .3s; }
.tchip:hover { transform: translateY(-4px); border-color: rgba(255,255,255,.25); }
.tchip .tool { width: 40px; height: 40px; margin: 0; border-radius: 11px; font-size: .85rem; }

/* ---------- work carousel ---------- */
.carousel { position: relative; }
.carousel__track { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 10px 4px 26px; cursor: grab; outline: none; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.carousel__track.is-dragging .slide { pointer-events: none; }
.slide { flex: 0 0 clamp(230px, 26vw, 320px); margin: 0; scroll-snap-align: start; position: relative; border-radius: 18px; overflow: hidden; background: var(--bg2); border: 1px solid var(--line); transform: rotate(var(--sr, 0deg)); transition: transform .5s var(--ease), box-shadow .5s; user-select: none; }
.slide:nth-child(odd) { --sr: -1.5deg; } .slide:nth-child(even) { --sr: 1.5deg; }
.slide:hover { transform: rotate(0) translateY(-8px) scale(1.02); box-shadow: 0 30px 60px -20px rgba(145,94,255,.6); }
.slide img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.slide figcaption { position: absolute; left: 12px; bottom: 12px; font-size: .68rem; padding: 4px 10px; border-radius: 999px; background: rgba(7,6,21,.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.carousel__ctrl { display: flex; align-items: center; gap: 14px; }
.carousel__btn { position: static; transform: none; }
.carousel__bar { flex: 1; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.carousel__bar span { display: block; height: 100%; width: 20%; background: linear-gradient(90deg, var(--brand), var(--magenta)); border-radius: 3px; transform: translateX(calc(var(--cp, 0) * 400%)); transition: transform .2s; }
.workcta { margin-top: 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 28px 30px; border-radius: 24px; border: 1px solid var(--line); background: radial-gradient(500px circle at 100% 0%, rgba(145,94,255,.3), transparent 60%), var(--bg2); }
.workcta h3 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-weight: 800; }
.workcta .hero__cta { margin-top: 0; }

/* ---------- contact ---------- */
.contact2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.contact2__info { display: grid; gap: 14px; }
.contact2__info .muted { margin-bottom: 6px; }
.cline { --rx: 0deg; --ry: 0deg; display: grid; padding: 16px 20px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; word-break: break-word; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .4s var(--ease), border-color .3s; }
.cline:hover { border-color: rgba(145,94,255,.5); }
.cline small { font-size: .66rem; color: var(--brand2); text-transform: uppercase; font-weight: 400; }
.cline--plain { margin: 0; }
.footer__big--name { font-size: clamp(4rem, 19vw, 17rem); }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .thero__inner { grid-template-columns: 1fr; }
  .stage { width: min(100%, 470px); margin-top: 10px; }
  .about2 { grid-template-columns: 1fr; }
  .portrait { max-width: 420px; }
  .skillsets { grid-template-columns: repeat(2, 1fr); }
  .contact2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .thero { padding: 100px 18px 60px; }
  .giant__row { font-size: 26vw; }
  .tool { width: 38px; height: 38px; margin: -19px 0 0 -19px; font-size: .8rem; border-radius: 11px; }
  .tag { font-size: .72rem; padding: 8px 11px; }
  .tag--b { right: 0; }
  .socials { flex-wrap: wrap; }
  .tl::before, .tl::after { left: 18px; }
  .tl__item { grid-template-columns: 1fr; gap: 0; padding-left: 48px; }
  .tl__item:nth-child(odd) .tl__card, .tl__item:nth-child(even) .tl__card { grid-column: 1; text-align: left; }
  .tl__dot { left: 18px; }
  .skillsets { grid-template-columns: 1fr; }
  .portrait__frame { inset: -10px 10px 10px -10px; }
  .portrait { margin-left: 10px; }
  .slide { flex-basis: 72vw; }
  .workcta { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .orbit, .orbit .tool, .stage__glow, .tools__row, .award__icon, .idcard__front::after { animation: none !important; }
  .ring .ring__bar { transition: none; }
}
