/* =========================================================
   Profile UI — Rainy Glass (handmade style)
   - Focus: clean tokens, readable layout, iPad-friendly perf
   ========================================================= */

:root{
  /* sizing */
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 14px;

  /* colors */
  --bg1: #05060a;
  --bg2: #081427;

  --text: rgba(245, 250, 255, .92);
  --muted: rgba(220, 230, 255, .70);
  --muted2: rgba(220, 230, 255, .55);

  --glass: rgba(255,255,255,.10);
  --glass2: rgba(255,255,255,.14);

  --bd: rgba(255,255,255,.14);
  --bd2: rgba(255,255,255,.20);

  --a1:#7a5cff;
  --a2:#00d4ff;
  --a3:#ff4fd8;
  --sp:#1DB954;

  /* shadows */
  --shadow: 0 24px 80px rgba(0,0,0,.45);
  --shadow-soft: 0 14px 44px rgba(0,0,0,.18);

  /* blur (keep sane for mobile) */
  --blur: 14px;
  --blur-soft: 12px;

  /* fonts */
  --font: "Plus Jakarta Sans","Inter",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* iOS safe area */
  --safeTop: env(safe-area-inset-top, 0px);
  --safeRight: env(safe-area-inset-right, 0px);
  --safeBottom: env(safe-area-inset-bottom, 0px);
  --safeLeft: env(safe-area-inset-left, 0px);
}

html[data-theme="light"]{
  --bg1:#f5f7ff;
  --bg2:#eef3ff;

  --text: rgba(10, 14, 18, .86);
  --muted: rgba(10, 14, 18, .62);
  --muted2: rgba(10, 14, 18, .52);

  --glass: rgba(255,255,255,.72);
  --glass2: rgba(255,255,255,.85);

  --bd: rgba(0,0,0,.10);
  --bd2: rgba(0,0,0,.14);

  --shadow: 0 24px 80px rgba(0,0,0,.18);
  --shadow-soft: 0 14px 44px rgba(0,0,0,.12);
}

*{ box-sizing:border-box }
html,body{ height:100% }

body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling: touch;

  padding: calc(10px + var(--safeTop)) calc(10px + var(--safeRight))
           calc(10px + var(--safeBottom)) calc(10px + var(--safeLeft));

  background:
    radial-gradient(900px 520px at 18% 12%, rgba(122,92,255,.22), transparent 60%),
    radial-gradient(900px 520px at 78% 18%, rgba(0,212,255,.18), transparent 62%),
    radial-gradient(900px 520px at 48% 88%, rgba(255,79,216,.12), transparent 62%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
}

/* subtle grain (cheap, looks premium) */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:1;
  opacity:.28;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.05), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(255,255,255,.04), transparent 36%),
    radial-gradient(circle at 50% 86%, rgba(255,255,255,.03), transparent 42%);
  mix-blend-mode: overlay;
}

/* =========================================================
   Ambient effects (lightweight)
   ========================================================= */
.rain{ position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden; }
.rain::before,.rain::after{
  content:"";
  position:absolute;
  inset:-25%;
  background-image: linear-gradient(to bottom,
    rgba(255,255,255,0), rgba(255,255,255,.18), rgba(255,255,255,0));
  background-size: 2px 170px;
  background-repeat: repeat;
  transform: rotate(12deg);
  opacity:.28;
  animation: rainFall 1.2s linear infinite;
  mix-blend-mode: screen;
  filter: blur(.35px);
}
.rain::after{ opacity:.18; animation-duration: 1.7s; filter: blur(.9px); }
@keyframes rainFall{
  0%{ background-position:0 -240px; }
  100%{ background-position:0 940px; }
}

.vignette{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:2;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 40%, rgba(0,0,0,.45) 92%);
}
html[data-theme="light"] .vignette{
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0), transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(0,0,0,.10) 92%);
}

.blob{
  position:fixed;
  width:540px; height:540px;
  border-radius:50%;
  z-index:2;
  opacity:.14;
  filter: blur(56px);
  pointer-events:none;
  animation: floaty 16s ease-in-out infinite;
}
.b1{ left:-170px; top:-190px; background:var(--a1); }
.b2{ right:-220px; top:-160px; background:var(--a2); animation-duration:18s; }
.b3{ left:22%; bottom:-250px; background:var(--a3); animation-duration:20s; }
@keyframes floaty{
  0%,100%{ transform:translate(0,0) scale(1); }
  50%{ transform:translate(18px,-16px) scale(1.04); }
}

/* =========================================================
   Layout
   ========================================================= */
.wrap{
  position:relative;
  z-index:5;
  min-height: calc(100vh - 20px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}

.card{
  width: min(980px, 96vw);
  border-radius: var(--r-lg);
  border: 1px solid var(--bd);
  background: linear-gradient(180deg, var(--glass2), var(--glass));
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  overflow:hidden;

  transform-style: preserve-3d;
  perspective: 900px;
  will-change: transform;
  position:relative;
}

.card::before{
  /* highlight frame */
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: calc(var(--r-lg) + 2px);
  background:
    radial-gradient(900px 420px at 18% 0%, rgba(0,212,255,.18), transparent 60%),
    radial-gradient(900px 420px at 82% 0%, rgba(122,92,255,.16), transparent 60%),
    radial-gradient(900px 520px at 50% 110%, rgba(255,79,216,.12), transparent 62%);
  opacity:.7;
  pointer-events:none;
}

.cardInner{
  transform-style: preserve-3d;
  transition: transform .14s ease;
  position:relative;
  z-index:1;
}

/* =========================================================
   Topbar
   ========================================================= */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px 12px;
  flex-wrap:wrap;

  background: rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.10);
}

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

.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;

  padding:8px 12px;
  border-radius:999px;

  background: rgba(255,255,255,.08);
  border: 1px solid var(--bd2);

  font-size:13px;
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.pulse{
  width:10px; height:10px;
  border-radius:50%;
  background:#35ff93;
  box-shadow: 0 0 18px rgba(53,255,147,.55);
  animation: pulse 1.2s infinite;
}
@keyframes pulse{
  0%{ transform:scale(1); opacity:1; }
  50%{ transform:scale(1.35); opacity:.65; }
  100%{ transform:scale(1); opacity:1; }
}

.btn{
  cursor:pointer;
  border:1px solid var(--bd2);
  background: rgba(255,255,255,.10);
  color: var(--text);

  padding:10px 12px;
  border-radius: var(--r-sm);

  display:inline-flex;
  gap:10px;
  align-items:center;

  transition: transform .12s ease, filter .12s ease;
  box-shadow: var(--shadow-soft);
  touch-action: manipulation;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.06); }
.btn:active{ transform: translateY(0) scale(.99); }

/* =========================================================
   Content
   ========================================================= */
.content{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:14px;
  padding:14px;
}
@media (max-width: 920px){
  .content{ grid-template-columns: 1fr; }
}

.panel{
  border-radius: var(--r-md);
  border:1px solid var(--bd2);
  background: rgba(255,255,255,.07);
  padding:14px;
  box-shadow: var(--shadow-soft);
  position:relative;
}

/* =========================================================
   Profile block
   ========================================================= */
.profileHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.leftHead{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:260px;
}

.avatar{
  width:74px; height:74px;
  border-radius: 22px;
  object-fit: cover;
  background: rgba(0,0,0,.15);
  border:1px solid rgba(255,255,255,.18);
  box-shadow: 0 16px 55px rgba(0,0,0,.25);
}

.name{
  margin:0;
  font-size:22px;
  font-weight:900;
  letter-spacing:.2px;
}
.bio{
  margin:6px 0 0;
  font-size:13px;
  line-height:1.55;
  color: var(--muted);
}

.kv{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:10px;
}
@media (max-width: 540px){
  .kv{ grid-template-columns: 1fr; }
}

.field{
  padding:12px;
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
}
.label{
  font-size:12px;
  letter-spacing:.25px;
  margin-bottom:6px;
  color: var(--muted);
}
.value{
  font-weight:900;
  font-size:14px;
}

.hobby{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}
.chip{
  padding:8px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  font-size:13px;
}

.quote{
  margin-top:14px;
  padding:12px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg,
    rgba(0,212,255,.12),
    rgba(122,92,255,.10),
    rgba(255,79,216,.08)
  );
  font-size:13px;
  line-height:1.6;
}

/* =========================================================
   Activity (uptime) — match screenshot vibe
   ========================================================= */
.activity{
  margin-top:14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(16, 18, 26, .56);
  box-shadow: 0 22px 70px rgba(0,0,0,.35);
  backdrop-filter: blur(var(--blur-soft));
  -webkit-backdrop-filter: blur(var(--blur-soft));
  position:relative;
  overflow:hidden;
}
.activity::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(520px 180px at 20% 0%, rgba(0,212,255,.16), transparent 60%),
    radial-gradient(520px 200px at 90% 20%, rgba(122,92,255,.14), transparent 62%);
  opacity:.8;
  pointer-events:none;
}

.activityHeader{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
  position:relative;
  z-index:1;
}

.codeIcon{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  font-weight: 900;
  font-family: var(--mono);
  color: rgba(120,255,220,.95);
  background: rgba(120,255,220,.08);
  border: 1px solid rgba(120,255,220,.20);
}

.activityLabel{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: rgba(220,230,255,.70);
  text-transform: uppercase;
}

.activityTitle{
  display:flex;
  align-items:center;
  gap:10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(245,250,255,.96);
  margin-bottom: 10px;
  position:relative;
  z-index:1;
}

.activityTime{
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .4px;
  color: rgba(220,230,255,.55);
  font-variant-numeric: tabular-nums;
  position:relative;
  z-index:1;
}

/* =========================================================
   Spotify
   ========================================================= */
.spotifyRow{ display:flex; gap:12px; align-items:center; }
.spotifyIcon{
  width:42px; height:42px;
  border-radius:16px;
  display:grid; place-items:center;
  background: rgba(29,185,84,.14);
  border:1px solid rgba(29,185,84,.30);
  box-shadow: 0 12px 30px rgba(29,185,84,.14);
}
.spotifyTitle{ margin:0; font-size:14px; font-weight:900; }
.spotifyMeta{ margin:6px 0 0; color: var(--muted); font-size:13px; }
.spotifyEmbed{
  margin-top:12px;
  width:100%;
  border: none;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.08);
}

/* =========================================================
   Contact
   ========================================================= */
.contact{ display:grid; gap:10px; margin-top:12px; }
.contact a{
  text-decoration:none;
  color: var(--text);
  border-radius:16px;
  padding:12px;

  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;

  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);

  transition: transform .12s ease, filter .12s ease;
  box-shadow: var(--shadow-soft);
  touch-action: manipulation;
}
.contact a:hover{ transform: translateY(-1px); filter: brightness(1.06); }
.contact a:active{ transform: translateY(0) scale(.99); }

.iconBox{
  width:36px; height:36px;
  border-radius:14px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.10);
}

.small{ font-size:12px; color: var(--muted); }

/* =========================================================
   Footer
   ========================================================= */
.footer{
  padding:14px 14px 16px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;

  color: var(--muted);
  font-size:12px;

  border-top:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}

/* =========================================================
   Uptime badge bottom-left
   ========================================================= */
.onlineTimer{
  position: fixed;
  left: 16px;
  bottom: calc(16px + var(--safeBottom));
  z-index: 50;

  display:inline-flex;
  align-items:center;
  gap:10px;

  padding: 10px 14px;
  border-radius: 14px;

  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.10);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);

  backdrop-filter: blur(var(--blur-soft));
  -webkit-backdrop-filter: blur(var(--blur-soft));

  font-weight: 900;
  font-size: 13px;
  letter-spacing: .2px;

  max-width: calc(100vw - 32px);
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.onlineTimer::before{
  content:"";
  width:10px; height:10px;
  border-radius:999px;
  background: radial-gradient(circle at 30% 30%, rgba(0,255,200,.95), rgba(0,140,255,.85));
  box-shadow: 0 0 16px rgba(0,190,255,.55);
  animation: pulseDot 1.2s ease-in-out infinite;
}
@keyframes pulseDot{
  0%,100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.25); opacity: 1; }
}

/* =========================================================
   Loading overlay
   ========================================================= */
.loading{
  position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  z-index:99999;

  background:
    radial-gradient(1200px 700px at 50% 40%, rgba(255,255,255,.07), rgba(0,0,0,.62)),
    linear-gradient(135deg, var(--bg1), var(--bg2));

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition: opacity .35s ease;
}
.loaderCard{
  width:min(560px, calc(100vw - 34px));
  padding: 26px 22px 18px;
  border-radius: 22px;
  background: rgba(16, 18, 26, .55);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 90px rgba(0,0,0,.55);
  text-align:center;
}

.spinner{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto 14px;

  border: 3px solid rgba(255,255,255,.14);
  border-top-color: rgba(90,168,255,.95);
  animation: spin 900ms linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* =========================================================
   Ripple
   ========================================================= */
.ripple{
  position:fixed;
  width:12px; height:12px;
  border-radius:50%;
  pointer-events:none;
  z-index:9999;

  transform: translate(-50%,-50%);
  background: radial-gradient(circle, rgba(255,255,255,.7), rgba(255,255,255,0) 60%);
  mix-blend-mode: screen;

  animation: ripple 700ms ease-out forwards;
}
@keyframes ripple{
  0%{ opacity:.9; transform:translate(-50%,-50%) scale(1); }
  100%{ opacity:0; transform:translate(-50%,-50%) scale(18); }
}

/* =========================================================
   Perf & accessibility
   ========================================================= */
@media (hover:none){
  .btn:hover, .contact a:hover{ transform:none; filter:none; }
  .card{ backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
}

@media (prefers-reduced-motion: reduce){
  .rain::before,.rain::after,.blob,.pulse,.onlineTimer::before,.spinner,.ripple{
    animation:none !important;
  }
  .cardInner,.btn,.contact a{ transition:none !important; }
}
