/* =========================================================
   Hassan — Personal page (Walnut & Gold)
   Minimal: portrait + name + three social accounts.
   ========================================================= */

/* ====== DESIGN TOKENS ====== */
:root {
  --walnut-0: #140b06;
  --walnut-1: #1a120b;
  --walnut-2: #221610;
  --walnut-3: #2c1c13;
  --walnut-4: #382416;
  --walnut-5: #4a2e1d;
  --walnut-6: #6b4324;

  --cream-0: #f6efe4;
  --cream-1: #e9ddc9;
  --cream-2: #c9b89b;
  --cream-3: #9c8c75;
  --cream-4: #6e5f4d;

  --gold-300: #f0d9b3;
  --gold-400: #e7c79a;
  --gold-500: #d4a574;
  --gold-600: #a87544;
  --gold-700: #7c5230;

  --bg: var(--walnut-1);
  --fg: var(--cream-1);
  --border: rgba(232, 199, 154, 0.12);
  --hairline: rgba(232, 199, 154, 0.08);

  --glass: rgba(28, 19, 12, 0.55);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,0.75), 0 10px 30px -10px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 60px -10px rgba(212, 165, 116, 0.25);

  --bd-a: rgba(232, 199, 154, 0.45);
  --bd-b: rgba(212, 165, 116, 0.35);
  --bd-c: rgba(232, 199, 154, 0.08);
  --bd-d: rgba(255, 255, 255, 0.05);

  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;

  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ====== RESET ====== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  letter-spacing: -0.005em;
  min-height: 100vh;
  position: relative;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(212, 165, 116, 0.35); color: var(--walnut-0); }

/* ====== AURORA BACKGROUND ====== */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(168, 117, 68, 0.18), transparent 60%),
    radial-gradient(ellipse 1000px 800px at 100% 50%, rgba(124, 82, 48, 0.12), transparent 60%),
    radial-gradient(ellipse 900px 700px at 0% 80%, rgba(40, 26, 16, 0.6), transparent 60%),
    var(--walnut-1);
}
.aurora__blob {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  will-change: transform;
}
.aurora__blob--1 {
  top: -200px; left: -100px;
  background: radial-gradient(circle, rgba(212, 165, 116, 0.35), transparent 70%);
  animation: auroraFloat1 24s ease-in-out infinite;
}
.aurora__blob--2 {
  top: 40%; right: -200px;
  background: radial-gradient(circle, rgba(168, 117, 68, 0.3), transparent 70%);
  animation: auroraFloat2 32s ease-in-out infinite;
}
.aurora__blob--3 {
  bottom: -200px; left: 30%;
  background: radial-gradient(circle, rgba(124, 82, 48, 0.4), transparent 70%);
  animation: auroraFloat3 28s ease-in-out infinite;
}
@keyframes auroraFloat1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(80px, 60px) scale(1.15); }
}
@keyframes auroraFloat2 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-100px, 80px) scale(1.1); }
}
@keyframes auroraFloat3 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(60px, -80px) scale(1.2); }
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(232, 199, 154, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 199, 154, 0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 30%, black 30%, transparent 80%);
}
.noise-overlay {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/></svg>");
  opacity: 0.05;
  mix-blend-mode: overlay;
}
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.5) 100%);
}

/* ====== GLASS PANEL ====== */
.glass-panel {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-radius: var(--r-lg);
}
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 40%);
  pointer-events: none;
}

/* ====== BORDER GRADIENT (masked pattern) ====== */
.border-gradient { position: relative; }
.border-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg,
    var(--bd-a) 0%, var(--bd-b) 30%, var(--bd-c) 60%, var(--bd-d) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity 0.4s var(--ease-out);
}
.border-gradient:hover::after { opacity: 1; }

/* ====== PAGE ====== */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(40px, 8vh, 80px);
  padding: clamp(40px, 8vh, 96px) clamp(20px, 4vw, 48px);
}

/* ====== PROFILE (portrait + name) ====== */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vh, 28px);
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.profile__portrait {
  position: relative;
  width: 100%;
  max-width: 320px;
  padding: 14px;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.profile__portrait-glow {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    rgba(212, 165, 116, 0.25) 90deg,
    transparent 180deg,
    rgba(168, 117, 68, 0.2) 270deg,
    transparent 360deg);
  animation: spin 20s linear infinite;
  filter: blur(40px);
  opacity: 0.6;
  z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.profile__portrait-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  aspect-ratio: 736 / 1308;   /* match uploaded portrait.jpg ratio */
  object-fit: cover;
  object-position: center;
  border-radius: var(--r-lg);
  display: block;
}
.profile__portrait-corner {
  position: absolute;
  width: 22px; height: 22px;
  border: 1.5px solid var(--gold-500);
  z-index: 2;
  pointer-events: none;
}
.profile__portrait-corner--tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.profile__portrait-corner--tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.profile__portrait-corner--bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.profile__portrait-corner--br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.profile__name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--cream-0);
}

/* Inner span carries the gold gradient so background-clip works reliably
   across Safari, Chrome, Firefox, and Edge (iOS Safari ignores the
   background-clip rule when applied to the parent <h1> in some cases). */
.profile__name-text {
  display: inline-block;
  background-image: linear-gradient(135deg, var(--gold-300), var(--gold-500) 50%, var(--gold-600));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  /* Fallback: solid gold if background-clip is unsupported */
  @supports not (background-clip: text) {
    color: var(--gold-500);
  }
}

/* Reduced-motion users still get the rich gradient, just without animation. */
@media (prefers-reduced-motion: no-preference) {
  .profile__name-text {
    background-size: 200% 200%;
    animation: nameShimmer 8s ease-in-out infinite;
  }
}

@keyframes nameShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ====== SOCIAL AVATAR (real profile photos) ====== */
.social-card__avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 72px;          /* larger so uploaded portraits read clearly */
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(232,199,154,0.25), rgba(232,199,154,0) 60%),
    linear-gradient(135deg, rgba(124,82,48,0.35), rgba(26,18,11,0.55));
  box-shadow:
    inset 0 0 0 1px rgba(232,199,154,0.35),
    0 6px 18px rgba(0,0,0,0.35);
  transition: transform 0.5s var(--ease-out, ease);
}
.social-card:hover .social-card__avatar { transform: rotate(-8deg) scale(1.05); }
.social-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
  -webkit-user-drag: none;
  user-select: none;
  /* uploaded portrait is 736x1308 (portrait). Crop to upper-center so
     the face stays in frame regardless of card size. */
  object-position: center 28%;
}
/* When the photo slot is filled by the simpleicons CDN icon
   (no local photo available) we show it centered and padded. */
.social-card__photo--cdn {
  width: 70%;
  height: 70%;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

/* ====== SOCIAL ====== */
.social {
  width: 100%;
  max-width: 920px;
}
.social__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.social-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.social-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.social-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-accent, transparent);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
  border-radius: inherit;
  pointer-events: none;
}
.social-card:hover::before { opacity: 0.08; }

.social-card__icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--card-accent, rgba(212, 165, 116, 0.12));
  color: var(--card-fg, var(--gold-400));
  flex-shrink: 0;
  transition: transform 0.5s var(--ease-out);
}
.social-card__icon svg { width: 22px; height: 22px; }
.social-card:hover .social-card__icon { transform: rotate(-8deg) scale(1.05); }

.social-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-left: 48px; /* reserve space for the larger .social-card__badge (now on the LEFT) */
}
.social-card__handle {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin: 0;
}
.social-card__name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  font-style: italic;
  margin: 0;
  color: var(--cream-0);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====== Brand badge (cdn.simpleicons.org) ====== */
/* Small floating chip anchored to the LEFT of each card
   (so the social-media SVG sits where the avatar used to be).
   Uses the simpleicons CDN; falls back to the inline SVG. */
.social-card__badge {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(232, 199, 154, 0.28),
    0 4px 12px rgba(0, 0, 0, 0.35);
  color: var(--card-fg, var(--gold-400));
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  z-index: 2;
}
.social-card:hover .social-card__badge {
  transform: translateY(-2px) scale(1.06);
  box-shadow:
    inset 0 0 0 1px rgba(232, 199, 154, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.45);
}
.social-card__badge-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* No filter — the local SVG already carries the brand's authentic colors
     (TikTok cyan/pink, Telegram blue, Instagram gradient). */
}
.social-card__badge-fallback {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: inherit;
}
.social-card__badge-fallback svg {
  width: 100%;
  height: 100%;
}

/* Avatar when only the CDN icon is available (no local photo).
   Looks like a rounded-square brand tile, consistent with .social-card__icon. */
.social-card__avatar--icon {
  border-radius: 14px;
}

/* ====== FOOTER ====== */
.footer {
  width: 100%;
  max-width: 920px;
  margin-top: clamp(16px, 3vh, 24px);
  padding: 18px 12px;
  text-align: center;
}
.footer__line {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--cream-3);
}
.footer__symbol {
  color: var(--gold-500);
  font-style: normal;
  margin-right: 4px;
}
.footer__name {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500) 50%, var(--gold-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 500;
}

/* ====== ACCESSIBILITY ====== */
:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
