/*
 * Copyright 2020 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

:root {
  /* Pokémon Theme Colors */
  --pokemon-red: #ee1515;
  --pokemon-red-dark: #c00;
  --pokemon-blue: #3b4cca;
  --pokemon-blue-dark: #2a3a9f;
  --pokemon-yellow: #ffcb05;
  --pokemon-yellow-dark: #c7a008;
  --pokemon-gold: #b3a125;

  /* Base colors */
  --background-color: #f0f4f8;
  --light-color: #fff;
  --dark-color: #2d3748;
  --text-color: #1a202c;
  --text-muted: #718096;
  --link-color: var(--pokemon-blue);
  --link-hover-color: var(--pokemon-blue-dark);

  /* Pokémon type colors */
  --type-normal: #a8a878;
  --type-fire: #f08030;
  --type-water: #6890f0;
  --type-electric: #f8d030;
  --type-grass: #78c850;
  --type-ice: #98d8d8;
  --type-fighting: #c03028;
  --type-poison: #a040a0;
  --type-ground: #e0c068;
  --type-flying: #a890f0;
  --type-psychic: #f85888;
  --type-bug: #a8b820;
  --type-rock: #b8a038;
  --type-ghost: #705898;
  --type-dragon: #7038f8;
  --type-dark: #705848;
  --type-steel: #b8b8d0;
  --type-fairy: #ee99ac;

  /* Gradients */
  --gradient-pokemon: linear-gradient(135deg, var(--pokemon-red) 0%, var(--pokemon-blue) 100%);
  --gradient-pokeball: linear-gradient(180deg, var(--pokemon-red) 0%, var(--pokemon-red) 45%, #333 45%, #333 55%, #fff 55%, #fff 100%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 12%), 0 1px 2px rgb(0 0 0 / 8%);
  --shadow-md: 0 4px 6px rgb(0 0 0 / 10%), 0 2px 4px rgb(0 0 0 / 6%);
  --shadow-lg: 0 10px 25px rgb(0 0 0 / 15%), 0 5px 10px rgb(0 0 0 / 5%);
  --shadow-pokemon: 0 4px 20px rgb(59 76 202 / 25%);

  /* fonts */
  --body-font-family: inter, 'Noto Sans KR', system-ui, sans-serif;
  --heading-font-family: inter, 'Noto Sans KR', system-ui, sans-serif;

  /* body sizes */
  --body-font-size-m: 18px;
  --body-font-size-s: 16px;
  --body-font-size-xs: 14px;

  /* heading sizes */
  --heading-font-size-xxl: 48px;
  --heading-font-size-xl: 36px;
  --heading-font-size-l: 28px;
  --heading-font-size-m: 24px;
  --heading-font-size-s: 20px;
  --heading-font-size-xs: 18px;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* nav height */
  --nav-height: 70px;
}

/* fallback font for Inter */
@font-face {
  font-family: inter-fallback;
  size-adjust: 107%;
  src: local('Arial');
}

@media (width >= 900px) {
  :root {
    --heading-font-size-xxl: 56px;
    --heading-font-size-xl: 42px;
    --heading-font-size-l: 32px;
    --heading-font-size-m: 26px;
    --heading-font-size-s: 22px;
    --heading-font-size-xs: 18px;
  }
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  display: none;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-m);
  line-height: 1.7;
}

body.appear {
  display: block;
}

/* Pokeball background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgb(238 21 21 / 3%) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgb(59 76 202 / 3%) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

header {
  height: var(--nav-height);
}

header .header,
footer .footer {
  visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-family: var(--heading-font-family);
  font-weight: 700;
  line-height: 1.2;
  scroll-margin: 40px;
  color: var(--dark-color);
}

h1 {
  font-size: var(--heading-font-size-xxl);
  background: var(--gradient-pokemon);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: var(--heading-font-size-xl);
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient-pokemon);
  border-radius: var(--radius-full);
}

h3 { font-size: var(--heading-font-size-l); }
h4 { font-size: var(--heading-font-size-m); }
h5 { font-size: var(--heading-font-size-s); }
h6 { font-size: var(--heading-font-size-xs); }

p,
dl,
ol,
ul,
pre,
blockquote {
  margin-top: 0.8em;
  margin-bottom: 0.5em;
}

code,
pre {
  font-size: var(--body-font-size-s);
}

pre {
  padding: 16px;
  border-radius: var(--radius-md);
  background-color: var(--dark-color);
  color: #fff;
  overflow-x: auto;
  white-space: pre;
}

main > div {
  margin: 40px 16px;
}

input,
textarea,
select,
button {
  font: inherit;
}

/* Links */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover-color);
}

/* Buttons - Pokeball style */
a.button:any-link,
button {
  box-sizing: border-box;
  display: inline-block;
  max-width: 100%;
  margin: 12px 0;
  border: none;
  border-radius: var(--radius-full);
  padding: 14px 32px;
  font-family: var(--body-font-family);
  font-style: normal;
  font-weight: 600;
  font-size: var(--body-font-size-s);
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  background: var(--gradient-pokemon);
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.button:hover,
a.button:focus,
button:hover,
button:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:disabled,
button:disabled:hover {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

a.button.secondary,
button.secondary {
  background: transparent;
  border: 2px solid var(--pokemon-blue);
  color: var(--pokemon-blue);
}

a.button.secondary:hover,
button.secondary:hover {
  background: var(--pokemon-blue);
  color: #fff;
}

main img {
  max-width: 100%;
  width: auto;
  height: auto;
}

.icon {
  display: inline-block;
  height: 24px;
  width: 24px;
}

.icon img {
  height: 100%;
  width: 100%;
}

/* Sections */
main > .section {
  margin: 48px 0;
}

main > .section > div {
  max-width: 1280px;
  margin: auto;
  padding: 0 24px;
}

main > .section:first-of-type {
  margin-top: 0;
}

@media (width >= 900px) {
  main > .section > div {
    padding: 0 40px;
  }

  main > .section {
    margin: 64px 0;
  }
}

/* Section metadata */
main .section.light,
main .section.highlight {
  background-color: var(--light-color);
  margin: 0;
  padding: 48px 0;
  border-radius: 0;
  position: relative;
}

main .section.highlight::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-pokemon);
}

/* Pokémon Card Style Utility */
.pokemon-card {
  background: var(--light-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pokemon-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-pokemon);
}

/* Strong/bold text styling */
strong {
  color: var(--pokemon-blue);
  font-weight: 600;
}

/* Lists styling */
ul {
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.5em;
}

li::marker {
  color: var(--pokemon-red);
}
