
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&family=Silkscreen:wght@400;700&display=swap');

/* THEME */
:root {
  --bg: #edf5f2;
  --paper: #fbfdfb;
  --paper-dark: #e6f0ed;
  --teal: #4f9c91;
  --teal-dark: #315f59;
  --teal-light: #d5eee7;
  --text: #354a46;
  --muted: #788c86;
  --border: #b8d8cf;
  --shadow: rgba(52, 93, 83, 0.10);
  --pink: #e7bfc9;
  --typewriter: "Pixelify Sans", "Courier New", monospace;
  --pixel-display: "Silkscreen", "Courier New", monospace;
}

/* BASE */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 0;
  scroll-behavior: smooth;
  scrollbar-color: var(--teal) var(--teal-light);
  scrollbar-width: thin;
}

body {
  min-width: 0;
  margin: 0;
  padding: 12px;
  color: var(--text);
  background:
    radial-gradient(circle, rgba(237, 245, 242, 0.2) 1.5px, transparent 1.7px) 0 0 / 18px 18px,
    #739C96;
  font: 14px/1.55 var(--typewriter);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--teal-light);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--teal);
  border: 2px solid var(--teal-light);
  border-radius: 8px;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: #267b70;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  color: var(--teal-dark);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 9px;
  box-shadow: 2px 2px 0 var(--border);
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

button:hover {
  background: var(--teal-light);
  transform: translateY(-1px);
  box-shadow: 2px 3px 0 var(--border);
}

button:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 var(--border);
}

:focus-visible {
  outline: 2px dashed var(--teal);
  outline-offset: 2px;
}

img,
iframe,
video {
  max-width: 100%;
}

/* HOMEPAGE */
.site-shell {
  width: min(100%, 1040px);
  min-width: 0;
  margin: 0 auto;
}

.site-header {
  margin: 0 auto 12px;
  padding: 15px 12px;
  text-align: center;
  background: rgba(251, 253, 251, 0.95);
  border: 2px solid var(--border);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(79, 156, 145, 0.15);
}

.site-logo {
  display: inline-block;
  color: var(--teal-dark);
  font: 700 clamp(20px, 3vw, 32px)/1.35 var(--pixel-display);
  text-decoration: none;
  text-shadow: 2px 2px 0 var(--teal-light);
}

.sparkle {
  display: inline-block;
  color: var(--teal);
  animation: twinkle 2.2s ease-in-out infinite;
}

@keyframes twinkle {
  50% {
    opacity: 0.45;
    transform: scale(0.88) rotate(10deg);
  }
}

.site-tagline {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

/* WELCOME + SPOTIFY LAYOUT */
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: stretch;
  gap: 12px;
  margin-bottom: 12px;
}

/* PANELS AND BOXES */
.panel,
.box,
.widget-card {
  min-width: 0;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.panel:hover,
.widget-card:hover {
  border-color: var(--teal);
  box-shadow: 4px 4px 0 rgba(79, 156, 145, 0.14);
}

.panel,
.box {
  padding: 11px;
}

.panel h2,
.box h2 {
  margin: 0 0 7px;
  color: var(--teal-dark);
  font-size: 1.1em;
}

.widget-title,
.section-heading,
.box-title {
  color: var(--teal-dark);
  font-family: var(--pixel-display);
}

.widget-title,
.box-title {
  font-size: 11px;
  line-height: 1.6;
}

.muted-text,
.small {
  color: var(--muted);
  font-size: 11px;
}

/* WELCOME PANEL */
.welcome-panel {
  min-width: 0;
}

.welcome-panel p {
  margin: 6px 0;
}

.reminder {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--teal-light);
  border-left: 3px solid var(--teal);
  border-radius: 0 7px 7px 0;
  font-size: 12px;
}

.legacy-link {
  display: inline-block;
  padding: 2px 5px;
  background: #f4faf7;
  border: 1px dashed var(--border);
  border-radius: 5px;
  text-decoration: none;
}

.legacy-link:hover {
  background: var(--teal-light);
}


/* SPOTIFY MUSIC WIDGET */
.music-panel {
  min-width: 0;
  align-self: start;
  overflow: hidden;
  background: var(--paper);
}

.music-panel h2 {
  font-family: var(--pixel-display);
  font-size: 11px;
  line-height: 1.8;
  margin-bottom: 4px;
}

.music-label,
.music-footer {
  color: var(--muted);
  font-size: 9px;
}

.music-label {
  margin: 2px 0 7px;
  letter-spacing: 0.3px;
}

.spotify-frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper-dark);
}

.spotify-frame iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
}

.music-footer {
  margin: 6px 0 0;
  text-align: center;
}


.spotify-frame {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper-dark);
}

.spotify-frame iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

.music-footer {
  margin: 8px 0 0;
  text-align: center;
}

/* CLOCK / STATUS, IF USED */
.status-panel {
  margin-bottom: 14px;
  padding: 10px 12px;
}

.status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.online-line,
#status-clock {
  color: var(--muted);
  font-size: 11px;
}

#status-clock {
  color: var(--teal);
  font-family: var(--pixel-display);
}

.online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #66b58b;
  box-shadow: 0 0 0 2px #e0f4e8;
}

.status-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 11px;
}

.status-items strong {
  color: var(--teal-dark);
  overflow-wrap: anywhere;
}

.status-edit-form {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.status-edit-form.is-open {
  display: grid;
}

.status-edit-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.status-edit-form input {
  width: 100%;
  min-width: 0;
  padding: 5px;
  color: var(--text);
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.status-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 6px;
}

/* HOMEPAGE WIDGET GRID */
.site-shell > main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  align-items: start;
  gap: 13px;
}

.feed-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  align-items: stretch;
  gap: 12px;
}

.feed-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.section-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-height: 24px;
  margin: 0 0 6px;
}

.section-heading {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
}

.section-kicker {
  color: var(--muted);
  font-size: 10px;
}

.feed-frame {
  display: block;
  width: 100%;
  height: 380px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--shadow);
}

/* PHOTO CORNER AND GUESTBOOK */
.photos-section {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0;
}

.photos-frame {
  height: 300px;
}

.lower-grid {
  display: contents;
}

.guestbook-section {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.guestbook-section > .widget-title,
.guestbook-section > p {
  margin: 0 0 6px;
}

.guestbook-panel {
  padding: 6px;
  overflow: hidden;
}

.guestbook-frame {
  display: block;
  width: 100%;
  height: 300px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--paper);
}

/* MYSTERY BUTTON AND VISITOR COUNTER */
.extras-panel {
  grid-column: 1 / -1;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.7fr);
  grid-template-areas:
    "mystery-title visitor-title"
    "mystery-button visitor-count"
    "mystery-message visitor-note";
  align-items: start;
  gap: 6px 12px;
}

.extras-panel > h2.widget-title:first-of-type {
  grid-area: mystery-title;
  margin: 0;
}

.extras-panel > #surprise-button {
  grid-area: mystery-button;
  justify-self: start;
  padding: 5px 8px;
  font-size: 11px;
}

.extras-panel > #surprise-message {
  grid-area: mystery-message;
  min-height: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.extras-panel > .dotted-divider {
  display: none;
}

.extras-panel > h2.widget-title:nth-of-type(2) {
  grid-area: visitor-title;
  margin: 0;
}

.extras-panel > .visitor-frame {
  grid-area: visitor-count;
  display: block;
  width: 180px;
  max-width: 100%;
  height: 75px;
  border: 0;
}

.extras-panel > .muted-text {
  grid-area: visitor-note;
  margin: 0;
  font-size: 10px;
}

/* FOOTER */
.site-footer {
  margin-top: 14px;
  padding: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.site-footer p {
  margin: 4px 0;
}

.back-top {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 100;
  padding: 6px 9px;
  color: var(--teal-dark);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 2px 2px 0 var(--border);
  font-size: 11px;
  text-decoration: none;
}

/* POST-IT WIDGET */
.postit-sidebar {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 9999;
  width: min(220px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  margin: 0;
}

.postit-card {
  background: #d9f0e9;
  border: 1px dashed #80afa2;
  border-radius: 10px;
  box-shadow: 3px 3px 0 rgba(52, 93, 83, 0.12);
}

.postit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  font-family: var(--pixel-display);
  font-size: 10px;
}

.postit-heading a {
  color: var(--teal-dark);
  text-decoration: none;
}

.postit-heading button {
  padding: 1px 6px;
  line-height: 1.3;
  font-family: var(--pixel-display);
}

.postit-content iframe {
  display: block;
  width: 100%;
  height: 140px;
  border: 0;
  border-radius: 0 0 9px 9px;
}

.postit-card.is-collapsed .postit-content {
  display: none;
}

.postit-card.is-collapsed {
  width: max-content;
  max-width: 220px;
}

/* INNER PAGE LAYOUTS */
.site-layout,
.photos-layout {
  display: grid;
  grid-template-columns: minmax(140px, 175px) minmax(0, 1fr) minmax(170px, 205px);
  gap: 13px;
  width: min(100%, 1180px);
  min-width: 0;
  margin: 0 auto;
  padding: 5px;
  align-items: start;
}

.photos-layout {
  grid-template-columns: minmax(145px, 180px) minmax(0, 1fr);
}

.site-main,
.photos-main {
  width: 100%;
  min-width: 0;
}

.sidebar {
  min-width: 0;
}

.sidebar-logo {
  display: inline-block;
  color: var(--teal-dark);
  font: 700 25px/1.2 var(--pixel-display);
  text-decoration: none;
}

.sidebar-label {
  margin: 7px 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.cloud-link {
  display: block;
  padding: 6px 8px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11px;
  text-decoration: none;
}

.cloud-link span {
  display: inline-block;
  width: 18px;
  color: var(--teal);
  text-align: center;
}

.cloud-link.active,
.cloud-link:hover {
  background: var(--teal-light);
}

.sidebar-deco,
.sidebar-status,
.sidebar-clock {
  margin: 8px 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.sidebar .widget-card {
  margin-bottom: 10px;
  padding: 9px;
}

.widget-heading {
  margin-bottom: 5px;
  color: var(--teal-dark);
  font-family: var(--pixel-display);
  font-size: 10px;
}

.widget-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
}

/* SIDEBAR PHOTO THUMBNAILS */
.photo-stack {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.photo-card {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 5px;
  overflow: hidden;
  background: var(--paper-dark);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 10px;
  text-decoration: none;
}

.photo-card img {
  display: block;
  width: 100%;
  height: clamp(58px, 8vw, 88px);
  object-fit: cover;
  border-radius: 5px;
}

.photo-card span,
.photo-card figcaption {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.right-sidebar-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--teal);
}

/* DIARY AND PHOTO PAGE CONTENT */
.box {
  margin-bottom: 12px;
}

.box p {
  margin: 6px 0;
}

.terminal-label {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 10px;
}

.date {
  color: var(--muted);
  font-family: var(--pixel-display);
  font-size: 9px;
}

.mood {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 7px;
  color: var(--teal-dark);
  background: var(--teal-light);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
}

.center {
  text-align: center;
}

.pixel,
.header-stars {
  color: var(--teal);
  font-family: var(--pixel-display);
  font-size: 11px;
}

.header-stars {
  margin-top: 5px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-link {
  display: inline-block;
  padding: 5px 7px;
  background: #f4faf7;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: 10px;
  text-decoration: none;
}

/* PHOTO CAROUSEL WIDGET */
body:has(.photo-widget) {
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.photo-widget {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 16px;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 4px;
}

.photo-carousel {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 0;
}

.photo-slide {
  display: none;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  animation: photo-appear 180ms ease-out;
}

.photo-slide.is-active {
  display: block;
}

.photo-slide[hidden] {
  display: none !important;
}

.photo-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.photo-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.photo-counter {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
  line-height: 16px;
}

@keyframes photo-appear {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* TABLET */
@media (max-width: 850px) {
  body {
    padding: 9px;
  }

  .intro-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  }

  .site-shell > main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  }

  .feed-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  }

  .site-layout,
  .photos-layout {
    grid-template-columns: minmax(0, 155px) minmax(0, 1fr);
    gap: 10px;
  }

  .right-sidebar {
    grid-column: 2;
  }
}

/* PHONE */
@media (max-width: 650px) {
  body {
    padding: 7px;
  }

  .site-header {
    padding: 12px 9px;
  }

  .site-logo {
    font-size: clamp(18px, 6vw, 27px);
  }

  /* Welcome panel above Spotify on narrow screens */
  .intro-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .music-panel {
    width: 100%;
  }

  .spotify-frame iframe {
    min-height: 352px;
  }

  .site-shell > main {
    display: block;
  }

  .feed-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 11px;
  }

  .feed-grid .feed-frame {
    height: 300px;
  }

  .photos-section,
  .guestbook-section {
    margin-top: 12px;
  }

  .photos-frame,
  .guestbook-frame {
    height: 280px;
  }

  .lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 0;
  }

  .guestbook-section,
  .lower-grid > .guestbook-panel,
  .extras-panel {
    grid-column: auto;
    grid-row: auto;
  }

  /* Keep mystery and visitor areas side by side */
  .extras-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(135px, 0.9fr);
    grid-template-areas:
      "mystery-title visitor-title"
      "mystery-button visitor-count"
      "mystery-message visitor-note";
    gap: 6px 9px;
  }

  .extras-panel > h2.widget-title:first-of-type {
    grid-area: mystery-title;
  }

  .extras-panel > #surprise-button {
    grid-area: mystery-button;
    justify-self: start;
    max-width: 100%;
    white-space: normal;
  }

  .extras-panel > #surprise-message {
    grid-area: mystery-message;
    min-height: 0;
    margin: 0;
    overflow-wrap: anywhere;
  }

  .extras-panel > .dotted-divider {
    display: none;
  }

  .extras-panel > h2.widget-title:nth-of-type(2) {
    grid-area: visitor-title;
  }

  .extras-panel > .visitor-frame {
    grid-area: visitor-count;
    width: 100%;
    max-width: 160px;
    height: 75px;
  }

  .extras-panel > .muted-text {
    grid-area: visitor-note;
    margin: 0;
  }

  .site-layout,
  .photos-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 2px;
  }

  .left-sidebar,
  .right-sidebar,
  .site-main,
  .photos-main {
    grid-column: 1;
    width: 100%;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-edit-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-carousel {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    gap: 4px;
  }

  .photo-arrow {
    width: 26px;
    height: 30px;
    font-size: 16px;
  }

  .back-top {
    right: 8px;
    bottom: 8px;
  }

  .postit-sidebar {
    position: static;
    width: 100%;
    max-width: 100%;
    margin: 12px auto 0;
  }

  .postit-content iframe {
    height: 170px;
  }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
