@import url('fonts.css');

:root {
  --bg-top: #f8efe4;
  --bg-bottom: #d8e6ef;
  --card: #fffaf4;
  --text: #1e2831;
  --muted: #4e5c66;
  --line: #b4c3ce;
  --accent: #0d6e72;
  --accent-hover: #0a565a;
  --shadow: rgba(23, 41, 61, 0.16);
  --glow-a-color: #f4b9a7;
  --glow-a-opacity: 0.65;
  --glow-b-color: #9dd9d2;
  --glow-b-opacity: 0.65;
  --card-mix: color-mix(in srgb, var(--card) 85%, white 15%);
  --avatar-border: #fff;
  --avatar-shadow: 0 10px 30px -12px rgba(14, 42, 52, 0.65);
  --link-bg: #ffffffd9;
  --link-border: color-mix(in srgb, var(--accent) 35%, white 65%);
  --link-color: var(--accent);
  --link-hover-color: #fff;
  --link-hover-bg: var(--accent-hover);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  height: -webkit-fill-available;
  min-height: 100%;
  background: linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: Beiruti, sans-serif;
  color: var(--text);
  background: transparent;
  overflow-x: hidden;
  position: relative;
}

.layout-shell {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: grid;
  place-items: center;
  padding-top: calc(2rem + env(safe-area-inset-top, 0px));
  padding-right: calc(1rem + env(safe-area-inset-right, 0px));
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  padding-left: calc(1rem + env(safe-area-inset-left, 0px));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
}

.theme-toggle {
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  right: calc(1rem + env(safe-area-inset-right, 0px));
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 80%, white 20%);
  color: var(--text);
  border-radius: 999px;
  padding: 0;
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px -14px var(--shadow);
  display: grid;
  place-items: center;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: color-mix(in srgb, var(--card) 65%, white 35%);
}

.theme-toggle i {
  line-height: 1;
}

.glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(35px);
  z-index: -1;
  opacity: 0.65;
}

.glow-a {
  width: 260px;
  height: 260px;
  background: var(--glow-a-color);
  opacity: var(--glow-a-opacity);
  top: -60px;
  left: -40px;
}

.glow-b {
  width: 300px;
  height: 300px;
  background: var(--glow-b-color);
  opacity: var(--glow-b-opacity);
  right: -70px;
  bottom: -90px;
}

.profile-card {
  width: min(560px, 100%);
  border: 1.5px solid var(--line);
  background: var(--card-mix);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px -18px var(--shadow);
  animation: rise-in 700ms ease-out;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--avatar-border);
  box-shadow: var(--avatar-shadow);
}

h1 {
  margin: 1rem 0 0.3rem;
  font-family: Alegreya, serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.links a {
  display: grid;
  grid-template-columns: 1.25rem auto;
  align-items: center;
  justify-content: center;
  column-gap: 0.65rem;
  width: 100%;
  text-decoration: none;
  font-weight: 500;
  color: var(--link-color);
  border: 1px solid var(--link-border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  background: var(--link-bg);
  transition: transform 120ms ease, background-color 120ms ease, color 120ms ease;
}

.links a i {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  line-height: 1;
  text-align: center;
}

.links a span {
  line-height: 1;
}

.links a:hover,
.links a:focus-visible {
  transform: translateY(-2px);
  color: var(--link-hover-color);
  background: var(--link-hover-bg);
}

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

@media (max-width: 520px) {
  .profile-card {
    padding: 1.6rem 1.2rem;
    border-radius: 20px;
  }

  .layout-shell {
    padding-top: calc(1.6rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.6rem + env(safe-area-inset-bottom, 0px));
  }

  .avatar {
    width: 108px;
    height: 108px;
  }

  .theme-toggle {
    top: calc(0.75rem + env(safe-area-inset-top, 0px));
    right: calc(0.75rem + env(safe-area-inset-right, 0px));
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-top: #0f1b24;
    --bg-bottom: #111827;
    --card: #142632;
    --text: #eaf3fb;
    --muted: #b4c3cf;
    --line: #2c4a5d;
    --accent: #7fd3cd;
    --accent-hover: #58b8b1;
    --shadow: rgba(0, 0, 0, 0.55);
    --glow-a-color: #7a3e3e;
    --glow-a-opacity: 0.45;
    --glow-b-color: #1f5d66;
    --glow-b-opacity: 0.5;
    --card-mix: color-mix(in srgb, var(--card) 92%, black 8%);
    --avatar-border: #1f3442;
    --avatar-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.8);
    --link-bg: #193141;
    --link-border: #34637a;
    --link-color: #9ce9e2;
    --link-hover-color: #07272a;
    --link-hover-bg: var(--accent-hover);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg-top: #0f1b24;
  --bg-bottom: #111827;
  --card: #142632;
  --text: #eaf3fb;
  --muted: #b4c3cf;
  --line: #2c4a5d;
  --accent: #7fd3cd;
  --accent-hover: #58b8b1;
  --shadow: rgba(0, 0, 0, 0.55);
  --glow-a-color: #7a3e3e;
  --glow-a-opacity: 0.45;
  --glow-b-color: #1f5d66;
  --glow-b-opacity: 0.5;
  --card-mix: color-mix(in srgb, var(--card) 92%, black 8%);
  --avatar-border: #1f3442;
  --avatar-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.8);
  --link-bg: #193141;
  --link-border: #34637a;
  --link-color: #9ce9e2;
  --link-hover-color: #07272a;
  --link-hover-bg: var(--accent-hover);
  color-scheme: dark;
}
