/*
  Fantasy Typography CSS

  This stylesheet adds a whimsical feel to headings, paragraphs and
  especially links without sacrificing readability. A dark backdrop
  contrasts with light text, while gradient accents and animated
  symbols introduce a touch of magic. Link interactions reveal
  subtle motion and glow.
*/

:root {
  --bg: white;             /* deep ocean blue backdrop */
  --text: black;           /* light text for high contrast */
  --accent1: #8c7ae6;        /* purple-blue primary accent */
  --accent2: #51aefc;        /* azure secondary accent */
  --shadow: rgba(0, 0, 0, 0.35);
  --link-hover-shadow: rgba(81, 174, 252, 0.8);
}

body {
  margin: 2.5rem;
  padding: 0;
  font-family: 'Segoe UI', 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Fancy h1 heading */
h1 {
  font-size: 2.8rem;
  margin: 1em 0 0.5em;
  font-weight: 700;
  letter-spacing: 1px;
  /* gradient fills the text */
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  position: relative;
  text-shadow: 0 4px 8px var(--shadow), 0 0 10px var(--accent1);
}

/* decorative underline beneath h1 */
h1::after {
  content: '';
  display: block;
  margin-top: 0.3em;
  width: 4rem;
  height: 3px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border-radius: 2px;
  box-shadow: 0 0 6px var(--accent1), 0 0 12px var(--accent2);
}

/* Fancy h2 heading */
h2 {
  font-size: 2rem;
  margin: 0.75em 0 0.4em;
  font-weight: 600;
  color: var(--accent1);
  position: relative;
  text-shadow: 0 3px 6px var(--shadow);
}

/* sparkling symbol before h2 */
h2::before {
  content: '\2727 '; /* sparkle star symbol */
  font-size: 1em;
  color: var(--accent2);
  margin-right: 6px;
}

p {
  font-size: 1rem;
  margin: 1em 0;
  color: var(--text);
  line-height: 1.6;
}

/* anchor tags with star and animated underline effect */
a {
  color: var(--accent1);
  text-decoration: none;
  position: relative;
  padding: 0.1em 0;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* star icon preceding link text */
a::before {
  content: '\2606'; /* hollow star */
  position: absolute;
  left: -1.3em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  color: var(--accent1);
  transition: color 0.3s ease, transform 0.5s ease;
}

/* decorative underline for links */
a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent1);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease, background 0.3s ease;
}

/* hover state for links */
a:hover {
  color: var(--accent2);
  text-shadow: 0 0 8px var(--link-hover-shadow);
}

/* animate star on hover */
a:hover::before {
  color: var(--accent2);
  transform: translateY(-50%) rotate(360deg);
}

/* expand underline on hover */
a:hover::after {
  transform: scaleX(1);
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
}