@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@500;700&family=Nunito:wght@500;700;800&family=Orbitron:wght@500;700&family=Rajdhani:wght@500;700&display=swap");

:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #edf4ff;
  --text: #1a2240;
  --text-soft: #42507a;
  --line: #dce6ff;
  --accent-1: #ff4f87;
  --accent-2: #3b82f6;
  --accent-3: #14b8a6;
  --header-bg: #3b82f6;
  --section-1-bg: #ff4f87;
  --section-2-bg: #14b8a6;
  --card-shadow: 0 10px 30px rgba(36, 62, 120, 0.14);
  --card-shadow-hover: 0 16px 34px rgba(25, 42, 92, 0.2);
  --link-color: #111827;
  --font-title: "Fredoka", sans-serif;
  --font-body: "Nunito", sans-serif;
  --card-radius: 16px;
  --card-border-width: 1px;
  --title-spacing: 0.02em;
}

html:has(#palete:checked) {
  --bg: #0f172f;
  --surface: #141f3f;
  --surface-soft: #1a2a58;
  --text: #f4f7ff;
  --text-soft: #c8d4ff;
  --line: #2d3f73;
  --accent-1: #ff72a6;
  --accent-2: #63b3ff;
  --accent-3: #2ce6cb;
  --header-bg: #1a2a58;
  --section-1-bg: #ff72a6;
  --section-2-bg: #2ce6cb;
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.45);
  --link-color: #f4f7ff;
}

html:has(#style-skin:checked) {
  --font-title: "Orbitron", sans-serif;
  --font-body: "Rajdhani", sans-serif;
  --surface: #f0f6ff;
  --surface-soft: #dce9ff;
  --line: #9fc3ff;
  --card-radius: 8px;
  --card-border-width: 2px;
  --title-spacing: 0.08em;
}

html:has(#style-skin:checked):has(#palete:checked) {
  --surface: #111a35;
  --surface-soft: #152349;
  --line: #4876d3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  min-height: 100vh;
}

#wrapper {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px 14px 28px;
}

header {
  border-radius: 26px;
  padding: 18px 16px;
  background: var(--header-bg);
  box-shadow: var(--card-shadow);
}

header h1 {
  margin: 0;
  color: #fff;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(2rem, 8.4vw, 4rem);
  line-height: 1;
  letter-spacing: var(--title-spacing);
  text-align: center;
  text-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

header > div {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

header a,
header .set-skin {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.16);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
  cursor: pointer;
}

header a:hover,
header .set-skin:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.28);
}

.theme-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.set-skin:not(.set-skin-style) > .fa-sun,
.set-skin-style > .fa-a {
  display: inline-block;
}

.set-skin:not(.set-skin-style) > .fa-moon,
.set-skin-style > .fa-rocket {
  display: none;
}

html:has(#palete:checked) .set-skin:not(.set-skin-style) > .fa-sun {
  display: none;
}

html:has(#palete:checked) .set-skin:not(.set-skin-style) > .fa-moon {
  display: inline-block;
}

html:has(#style-skin:checked) .set-skin-style > .fa-a {
  display: none;
}

html:has(#style-skin:checked) .set-skin-style > .fa-rocket {
  display: inline-block;
}

main {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

section {
  border-radius: 22px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(33, 49, 95, 0.08);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

section h1 {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 12px;
  border-radius: 14px;
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: var(--title-spacing);
  color: #fff;
}

section:nth-of-type(1) h1 {
  background: var(--section-1-bg);
}

section:nth-of-type(2) h1 {
  background: var(--section-2-bg);
}

.title-icon {
  margin-right: 8px;
  font-size: 0.95em;
}

header h1 .title-icon,
section h1 .title-icon {
  color: #fff !important;
}

.card-title .title-icon {
  color: currentColor !important;
}

.card a {
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 10px;
  min-height: 130px;
  align-items: center;
  text-decoration: none;
  color: var(--link-color);
  padding: 12px;
  border-radius: var(--card-radius);
  background: var(--surface);
  border: var(--card-border-width) solid var(--line);
  box-shadow: var(--card-shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.card a:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--accent-2);
}

.card img {
  grid-area: icon;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  background: transparent;
  padding: 4px;
}

.card-image {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1px solid var(--line);
}

.card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.2;
  font-family: var(--font-title);
  letter-spacing: var(--title-spacing);
}

.card-description {
  margin-top: 2px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.25;
}

footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.98rem;
  font-weight: 800;
}

footer a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

footer a:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

html:has(#palete:checked) .card > a > .card-image > img {
  filter: invert(1);
}

html:has(#style-skin:checked) section,
html:has(#style-skin:checked) .card a,
html:has(#style-skin:checked) header {
  box-shadow: none;
}

html:has(#style-skin:checked) .card a {
  text-transform: uppercase;
}

@media screen and (min-width: 600px) {
  #wrapper {
    padding: 24px 20px 36px;
  }

  section {
    padding: 16px;
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (min-width: 900px) {
  section {
    grid-template-columns: 1fr;
    align-self: start;
  }
  main {
    grid-template-columns: 1fr 1fr;
  }
}
