/* ==========================================================================
   solarpunked.online — Indie Web / Brutalist Stylesheet
   Zero animations. Zero transitions. Raw HTML energy.
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: "Courier New", Courier, monospace;
  background-color: #ffffff;
  color: #000000;
  line-height: 1.6;
  padding: 1rem;
  max-width: 960px;
  margin: 0 auto;
}

#hydra-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.2;
  pointer-events: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 1.8rem;
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
}

.header-banner {
  margin-bottom: 0.5rem;
  border: 3px solid #000;
}

.site-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: cover;
}

h2 {
  font-size: 1.3rem;
  margin-top: 0;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin-bottom: 0.75rem;
}

small {
  font-size: 0.85rem;
  color: #333333;
}

pre {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

hr {
  border: none;
  border-top: 1px solid #000000;
  margin: 1rem 0;
}

/* --- Links (classic web) --- */
a:link {
  color: #0000EE;
  text-decoration: underline;
}

a:visited {
  color: #551A8B;
}

a:hover {
  color: #0000EE;
}

a:active {
  color: #FF0000;
}

/* --- Header --- */
header {
  background-color: rgba(255, 255, 255, 0.93);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #000;
}

.site-nav {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding-top: 0.25rem;
}

.site-nav a {
  margin-right: 0.15rem;
}

.site-nav a[aria-current="page"] {
  font-weight: bold;
  text-decoration: none;
  color: #000000;
}

/* --- Layout: 2-Column Grid --- */
.site-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

/* --- Sections --- */
.section-box {
  background-color: rgba(255, 255, 255, 0.93);
  border: 1px solid #000000;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.05);
}

.section-box h2 {
  border-bottom: 1px solid #000000;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}

/* --- Highlight Project Card --- */
.highlight-card {
  border: 1px solid #000000;
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.highlight-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #f0f0f0;
  border-bottom: 1px solid #000000;
}

.highlight-content {
  padding: 0.75rem;
}

.highlight-content h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.highlight-content p {
  margin-bottom: 1rem;
}

.btn-primary-link {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background-color: #000000;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.btn-primary-link:hover {
  background-color: #333333;
}

/* --- Sidebar --- */
.sidebar .section-box {
  margin-bottom: 1rem;
}

/* --- Embeds --- */
.embed-slot {
  border: 1px dashed #999999;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  min-height: 80px;
  background-color: #f9f9f9;
}

.embed-slot p {
  font-size: 0.85rem;
  color: #666666;
  margin: 0;
}

.media-item {
  margin-bottom: 4rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 2rem;
}

.media-item:last-child {
  border-bottom: none;
}

.type-badge {
  display: inline-block;
  background: #000;
  color: #fff;
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  font-family: "Courier New", Courier, monospace;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.item-description {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-style: italic;
  opacity: 0.8;
}

.item-comments {
  margin-top: 0.75rem;
}

.toggle-comments {
  background: #f0f0f0;
  border: 1px solid #000000;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.8rem;
}

.comment-box-wrapper {
  display: none;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #000000;
  background-color: #fafafa;
}

.comment-box-wrapper.active {
  display: block;
}

.mini-comment-form input,
.mini-comment-form textarea {
  width: 100%;
  padding: 0.35rem;
  margin-bottom: 0.5rem;
  border: 1px solid #000000;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
}

.mini-comment-form button {
  padding: 0.25rem 0.75rem;
  border: 1px solid #000000;
  background-color: #000000;
  color: #ffffff;
  cursor: pointer;
}

iframe {
  border: none;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* --- Download List --- */
.download-list {
  list-style: none;
  padding: 0;
}

.download-list li {
  margin-bottom: 0.5rem;
  font-family: "Courier New", Courier, monospace;
}

.download-list li span.filesize {
  color: #555555;
  font-size: 0.85rem;
}

/* --- Address Book / Links --- */
.link-list {
  list-style: disc;
  padding-left: 1.25rem;
}

.link-list li {
  margin-bottom: 0.35rem;
}

.link-category {
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

/* --- Guestbook Form --- */
.guestbook-form label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.2rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.guestbook-form input[type="text"],
.guestbook-form textarea {
  width: 100%;
  padding: 0.35rem;
  margin-bottom: 0.5rem;
  border: 1px solid #000000;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  background-color: #ffffff;
}
.guestbook-form textarea {
  min-height: 120px;
  resize: vertical;
}

.guestbook-form button {
  padding: 0.5rem 1.5rem;
  border: 1px solid #000000;
  background-color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  cursor: pointer;
}

/* --- Footer --- */
.site-footer {
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 2px solid #000000;
  text-align: center;
  font-size: 0.8rem;
  background-color: rgba(255, 255, 255, 0.93);
}

/* ==========================================================================
   ME PAGE
   ========================================================================== */

.me-page {
  max-width: 640px;
  margin-top: 1rem;
}

.me-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.avatar {
  border: 1px solid #000000;
  display: block;
  image-rendering: auto;
}

.me-intro {
  flex: 1;
}

.me-intro h2 {
  border-bottom: none;
  margin-bottom: 0.15rem;
}

.me-tagline {
  font-style: italic;
  color: #333333;
  margin-bottom: 0;
}

#me-contact-section pre {
  background-color: #f9f9f9;
  border: 1px dashed #999999;
  padding: 0.5rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   ADMIN PAGE
   ========================================================================== */

.admin-page {
  margin-top: 1rem;
}

.admin-warning {
  border: 2px solid #cc0000;
  background-color: #fff5f5;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #cc0000;
  font-weight: bold;
}

/* Tab Navigation */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 2px solid #000000;
  margin-bottom: 1rem;
}

.admin-tabs button {
  padding: 0.4rem 0.75rem;
  border: 1px solid #000000;
  border-bottom: none;
  background-color: #f0f0f0;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: -2px;
}

.admin-tabs button.active {
  background-color: #ffffff;
  font-weight: bold;
  border-bottom: 2px solid #ffffff;
}

/* Tab Panels */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Admin Forms */
.admin-field {
  margin-bottom: 0.75rem;
}

.admin-field label {
  display: block;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.admin-field input[type="text"],
.admin-field input[type="url"],
.admin-field textarea {
  width: 100%;
  padding: 0.35rem;
  border: 1px solid #000000;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  background-color: #ffffff;
}

.admin-field textarea {
  min-height: 100px;
  resize: vertical;
}

.admin-field small {
  display: block;
  margin-top: 0.15rem;
}

/* Repeatable Item Groups */
.item-group {
  border: 1px dashed #999999;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.item-group .item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.item-group .item-header span {
  font-weight: bold;
  font-size: 0.85rem;
  font-family: Arial, Helvetica, sans-serif;
}

/* Admin Buttons */
.btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid #000000;
  background-color: #ffffff;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-danger {
  border-color: #cc0000;
  color: #cc0000;
}

.btn-primary {
  background-color: #000000;
  color: #ffffff;
}

.media-item h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.preview-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.preview-item .btn-primary-link {
  margin-top: 1rem;
}

.btn-add {
  margin-top: 0.25rem;
  margin-bottom: 0.75rem;
}

/* Action Bar */
.admin-actions {
  border-top: 2px solid #000000;
  padding-top: 0.75rem;
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-status {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
}

/* ==========================================================================
   JOURNAL / BLOG
   ========================================================================== */

.journal-section {
  margin-bottom: 4rem;
}

.blog-feed {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-post {
  border: 3px solid var(--fg);
  padding: 1.5rem;
  background: var(--bg);
  box-shadow: 8px 8px 0 var(--fg);
}

.post-meta {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 0.25rem;
}

.post-content {
  line-height: 1.6;
  white-space: pre-wrap;
}

.post-media {
  margin-top: 1rem;
  border-top: 1px solid var(--fg);
  padding-top: 1rem;
}

.post-media img {
  max-width: 100%;
  border: 2px solid var(--fg);
}

/* Zines */
.zine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.zine-card {
  border: 3px solid var(--fg);
  background: var(--bg);
  box-shadow: 6px 6px 0 var(--fg);
  display: flex;
  flex-direction: column;
}

.zine-cover {
  height: 350px;
  background-size: cover;
  background-position: center;
  border-bottom: 3px solid var(--fg);
  background-color: var(--fg);
}

.zine-info {
  padding: 1.25rem;
}

.zine-info h3 {
  margin-bottom: 0.5rem;
}

.zine-info p {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  opacity: 0.85;
}

/* Tools */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tool-card {
  border: 3px solid var(--fg);
  padding: 1.5rem;
  background: var(--bg);
  box-shadow: 8px 8px 0 var(--fg);
}

.tool-header {
  border-bottom: 1px solid var(--fg);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.tool-type {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.tool-body p {
  margin-bottom: 1.5rem;
}

.download-btn {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-weight: bold;
}
/* ==========================================================================
   AVATAR MESSENGER
   ========================================================================== */

.avatar-messenger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: flex-end;
  gap: 15px;
  z-index: 1000;
  max-width: 350px;
  pointer-events: none;
}

.avatar-bubble {
  background-color: rgba(255, 255, 255, 0.93);
  border: 2px solid #000000;
  padding: 0.75rem 1rem;
  border-radius: 20px;
  border-bottom-right-radius: 0;
  max-width: 80%;
  font-size: 0.9rem;
  font-family: "Courier New", Courier, monospace;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.5s ease;
  min-width: 150px;
  position: relative;
  pointer-events: auto;
}

.avatar-bubble::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: -10px;
  width: 0;
  height: 0;
  border: 10px solid transparent;
  border-left-color: #000000;
  border-bottom: 0;
  margin-bottom: -2px;
}

.avatar-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

.avatar-bubble .Typewriter__wrapper p {
  display: inline;
  margin: 0;
}

.avatar-messenger img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #000000;
  box-shadow: 4px 4px 0 #000000;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.2s ease;
  background-color: #f0f0f0;
}

#avatar-messenger-slot {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
}

.avatar-messenger {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none; /* bubble shouldn't block clicks */
}

.avatar-messenger img, .social-menu {
  pointer-events: auto; /* Re-enable for interactive parts */
}

.social-menu {
  position: absolute;
  bottom: 80px;
  right: 0;
  display: none;
  gap: 12px;
  padding: 10px;
  z-index: 1000;
  flex-direction: row;
}

.social-menu.visible {
  display: flex;
  animation: slideInUp 0.3s ease forwards;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.social-menu a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #000;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 4px 4px 0 #000;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: #000;
  text-decoration: none;
}

.social-menu a:hover {
  transform: translate(-2px, -2px) scale(1.1);
  box-shadow: 6px 6px 0 #000;
  background: #000;
  color: #fff;
}

.social-menu a svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.avatar-messenger img:hover {
  transform: scale(1.1);
}

@media (max-width: 640px) {
  body {
    padding: 0.75rem;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    font-size: 15px;
  }

  h1 {
    font-size: 1.35rem;
    word-break: break-word;
  }

  h2 {
    font-size: 1.15rem;
  }

  /* Featured Project */
  .highlight-content h3 {
    font-size: 1.25rem;
  }

  .highlight-image {
    height: 180px;
  }

  /* Grid collapse & Reorder (Sidebar/SOTD on top) */
  .site-wrapper {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .sidebar {
    display: contents;
  }

  #sotd {
    order: -2;
  }

  .main-content {
    order: -1;
  }

  /* Header & Banner Mobile */
  header {
    padding: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .header-banner {
    margin: -0.75rem -0.75rem 0.5rem -0.75rem;
    max-height: 140px;
    overflow: hidden;
  }

  .site-banner {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* Avatar Messenger Mobile */
  #avatar-messenger-slot {
    bottom: 15px;
    right: 15px;
    transform: scale(0.8);
    transform-origin: bottom right;
  }

  .avatar-bubble {
    width: 200px;
    max-width: 70vw;
    font-size: 0.85rem;
  }

  #address-book {
    order: 0;
  }

  #guestbook {
    order: 1;
  }

  /* Section spacing */
  .section-box {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }

  /* Navigation — bigger tap targets */
  .site-nav {
    font-size: 1rem;
    padding: 0.35rem 0;
    line-height: 2;
  }

  .site-nav a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 0.25rem;
  }

  /* Embed slots */
  .embed-slot {
    min-height: 60px;
    padding: 0.4rem;
    margin-bottom: 0.5rem;
  }

  /* Download list — bigger tap targets */
  .download-list li {
    padding: 0.35rem 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  /* Link list — bigger tap targets */
  .link-list li {
    padding: 0.2rem 0;
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  /* Guestbook form */
  .guestbook-form input[type="text"],
  .guestbook-form textarea {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 0.5rem;
  }

  .guestbook-form button {
    font-size: 16px;
    padding: 0.5rem 1.25rem;
    min-height: 44px;
    width: 100%;
  }

  /* --- ME PAGE MOBILE --- */
  .me-page {
    max-width: 100%;
  }

  .me-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }

  .me-intro h2 {
    font-size: 1.25rem;
  }

  #me-contact-section pre {
    font-size: 0.8rem;
    overflow-x: auto;
  }

  /* --- ADMIN PANEL MOBILE --- */
  .admin-warning {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .admin-tabs {
    flex-direction: column;
  }

  .admin-tabs button {
    border-bottom: 1px solid #000000;
    margin-bottom: 0;
    min-height: 44px;
    font-size: 0.9rem;
  }

  .admin-field input[type="text"],
  .admin-field input[type="url"],
  .admin-field textarea {
    font-size: 16px; /* prevents iOS zoom */
    padding: 0.5rem;
  }

  .btn {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }

  .admin-actions {
    flex-direction: column;
  }

  .admin-actions .btn {
    width: 100%;
    text-align: center;
  }

  .item-group .item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* --- JOURNAL MOBILE --- */
  .journal-section {
    margin-bottom: 2.5rem;
  }

  .blog-post {
    padding: 1rem;
    box-shadow: 4px 4px 0 var(--fg);
  }

  .zine-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .zine-cover {
    height: 300px;
  }

  /* --- ADMIN REFINEMENTS --- */
  .admin-tabs {
    display: flex;
    overflow-x: auto;
    flex-direction: row !important; /* Allow horizontal scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid var(--fg);
  }

  .admin-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
    border: 2px solid var(--fg);
    border-bottom: 0;
    margin-bottom: -3px;
    padding: 0.5rem 1rem;
  }
}

/* Extra small screens (320px) */
@media (max-width: 360px) {
  body {
    padding: 0.5rem;
    font-size: 14px;
  }

  h1 {
    font-size: 1.2rem;
  }

  .section-box {
    padding: 0.5rem;
  }

  .admin-tabs button {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
  }
}
