/* Pip the Tulip — whimsical soft aesthetic */
:root {
  --sky: #7eb8e8;
  --sky-soft: #a8d4f0;
  --panel: #c5e0f5;
  --panel-hover: #b5d6ef;
  --footer-bg: #a8cce8;
  --ink: #3d5a80;
  --ink-dark: #2c4566;
  --coral: #e85a4f;
  --white: #ffffff;
  --cloud: #f5f9fc;
  --radius: 1.25rem;
  --shadow: 0 8px 24px rgba(61, 90, 128, 0.12);
  --font: "Fredoka", "Quicksand", system-ui, sans-serif;
  --max: 960px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--sky);
  background-image: url("../assets/sky-bg.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Fallback soft cloud gradient if image slow */
@supports (background-image: url("../assets/sky-bg.jpg")) {
  body {
    background-color: #8ec4ea;
  }
}

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

a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--ink-dark);
}

a:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* —— Header / Logo —— */
.site-header {
  text-align: center;
  padding: 1.75rem 1rem 0.5rem;
}

.logo-link {
  display: inline-block;
}

.logo-link:hover {
  transform: scale(1.03);
}

.logo {
  width: min(280px, 70vw);
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(61, 90, 128, 0.15));
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem 0;
  font-weight: 500;
  font-size: 1.05rem;
}

.site-nav a {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(4px);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-dark);
}

/* —— Main —— */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

/* Home panels */
.home-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 2rem;
  margin-top: 0.5rem;
}

.panel-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.panel-label {
  font-family: var(--font);
  font-weight: 600;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  color: var(--white);
  text-shadow:
    0 1px 0 rgba(61, 90, 128, 0.25),
    0 2px 8px rgba(61, 90, 128, 0.2);
  letter-spacing: 0.02em;
  margin-bottom: 0.65rem;
  /* handwritten soft look */
  font-style: italic;
  transform: rotate(-1deg);
}

.panel-card:nth-child(2) .panel-label {
  transform: rotate(1deg);
}

.panel-box {
  background: var(--panel);
  border-radius: var(--radius);
  min-height: clamp(200px, 28vw, 280px);
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.55);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.panel-card:hover .panel-box,
.panel-card:focus-within .panel-box {
  background: var(--panel-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(61, 90, 128, 0.18);
}

.panel-hint {
  font-size: 0.95rem;
  color: var(--ink);
  opacity: 0.75;
  font-weight: 400;
}

.panel-box--preview {
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
}

.panel-preview {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: rgba(255, 255, 255, 0.45);
}

.panel-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.panel-box--preview .panel-hint {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  z-index: 1;
  margin: 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink-dark);
  opacity: 1;
  font-weight: 500;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(61, 90, 128, 0.15);
}

.panel-card:hover .panel-box--preview .panel-hint,
.panel-card:focus-within .panel-box--preview .panel-hint {
  background: var(--white);
}

/* Page titles */
.page-title {
  text-align: center;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  color: var(--white);
  text-shadow: 0 2px 10px rgba(61, 90, 128, 0.3);
  margin-bottom: 0.35rem;
}

.page-intro {
  text-align: center;
  color: var(--ink-dark);
  background: rgba(255, 255, 255, 0.55);
  display: inline-block;
  margin: 0 auto 1.75rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.95rem;
  max-width: 36rem;
}

.page-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Gallery grids */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  aspect-ratio: 1;
  background: var(--panel);
  border-radius: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.95;
  transition: transform 0.2s ease;
  overflow: hidden;
  padding: 0;
}

a.gallery-item {
  text-decoration: none;
  color: inherit;
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item span {
  opacity: 0.65;
  text-align: center;
  padding: 0.5rem;
}

.back-home {
  display: inline-block;
  margin-top: 1.75rem;
  padding: 0.5rem 1.1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  font-weight: 500;
}

.back-home:hover {
  background: var(--white);
}

.center-wrap {
  text-align: center;
}

/* —— Character parade —— */
.parade {
  width: 100%;
  margin-top: auto;
  line-height: 0;
  overflow: hidden;
}

.parade img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  object-position: center top;
}

/* —— Footer —— */
.site-footer {
  background: var(--footer-bg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.portrait {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.footer-identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink-dark);
}

.footer-email {
  font-size: 0.875rem;
  color: var(--ink);
  word-break: break-all;
}

.footer-email:hover {
  color: var(--coral);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dark);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
}

.social-icon:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--coral);
  transform: translateY(-2px);
}

.social-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* —— Responsive —— */
@media (max-width: 640px) {
  .home-panels {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .panel-box {
    min-height: 160px;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-social {
    align-self: flex-end;
  }

  .parade img {
    max-height: 120px;
  }

  body {
    background-attachment: scroll;
  }
}

@media (max-width: 380px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}
