@import url('https://fonts.googleapis.com/css2?family=Coming+Soon&display=swap');

@font-face {
  font-family: 'MariFont';
  src: url('../fonts/mariafernandafont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root,
[data-theme="dark"] {
  --bg:         #0f0f0f;
  --bg-card:    #1a1a1a;
  --border:     #ffffff;
  --text:       #f0f0f0;
  --text-muted: #aaaaaa;
  --accent:     #ffffff;
  --logo-filter: brightness(0) invert(1);
  --nav-border: #2a2a2a;
  --font-main: 'MariFont', cursive;
  --font-size-base: 1.1rem;
  --radius: 4px;
  --card-border: 2px solid var(--border);
}

[data-theme="light"] {
  --bg:         #f5f5f5;
  --bg-card:    #ffffff;
  --border:     #111111;
  --text:       #1a1a1a;
  --text-muted: #555555;
  --accent:     #111111;
  --logo-filter: brightness(0);
  --nav-border: #cccccc;
}

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

html {
  font-size: 20px;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  font-weight: bold;
  letter-spacing: -0.12em;
  word-spacing: 0.15em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 max(0.75rem, calc(50vw - 25rem));
  overflow-wrap: break-word;
  animation: fadeIn 0.4s ease;
  transition: letter-spacing 0.2s ease, word-spacing 0.2s ease;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

ul {
  list-style: none;
}

.navbar {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--nav-border);
  margin-bottom: 3rem;
  width: 100vw;
  margin-left: calc(-1 * max(0.75rem, calc(50vw - 25rem)));
  padding-left: max(0.75rem, calc(50vw - 25rem));
  padding-right: max(0.75rem, calc(50vw - 25rem));
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  box-sizing: border-box;
}

.navbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 13.333rem;
}

.logo-img {
  width: 13.333rem;
  height: 13.333rem;
  min-width: 13.333rem;
  max-width: 100%;
  object-fit: contain;
  filter: var(--logo-filter);
  flex-shrink: 0;
}

nav {
  display: flex;
  gap: 2rem;
}

.nav-group {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  flex: 1;
  justify-content: center;
}

.nav-controls {
  flex-shrink: 0;
}

.nav-link {
  font-family: var(--font-main);
  font-size: 1.2rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover {
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.active::after {
  transform: scaleX(1);
}

.lang-toggle,
.theme-toggle,
.font-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: bold;
  padding: 0;
  margin: 0;
  line-height: inherit;
  color: inherit;
  display: inline;
}

.font-toggle {
  letter-spacing: 0;
}

.a-sm { font-size: 0.7em; }
.a-lg { font-size: 1.3em; }

.card {
  background: var(--bg-card);
  border: var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.card-link {
  display: inline-block;
  margin-top: auto;
  font-size: 1rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.card-link:hover {
  color: var(--text);
  text-decoration: none;
}

.divider {
  width: 3rem;
  height: 2px;
  background: var(--text-muted);
  margin: 2rem 0;
  border-radius: 2px;
}

.footer {
  margin-top: auto;
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--nav-border);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes quackFade {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.3); }
}

.quack-bubble {
  position: fixed;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  pointer-events: none;
  z-index: 999;
  animation: quackFade 0.8s ease forwards;
}

html.font-alt {
  --font-main: 'Coming Soon', system-ui, -apple-system, sans-serif;
}

html.font-alt body {
  letter-spacing: normal;
  word-spacing: normal;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.post-page {
  max-width: 720px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.post-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.post-page-date {
  font-size: 1rem;
  color: var(--text-muted);
}

.post-page-tag {
  font-size: 1rem;
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
  border-radius: var(--radius);
  padding: 0.15rem 0.6rem;
  text-transform: uppercase;
}

.post-page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  line-height: 1.2;
}

.post-page-content {
  font-size: 1.3rem;
  line-height: 1.8;
  color: var(--text);
}

.post-page-content p {
  margin-bottom: 1.2rem;
}

@media (max-width: 700px) {
  .navbar {
    gap: 0;
  }

  .navbar-main {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .logo {
    width: 7.778rem;
  }

  .logo-img {
    width: 7.778rem;
    height: 7.778rem;
    min-width: 7.778rem;
  }

  .nav-group {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  nav {
    gap: 1.2rem;
    justify-content: center;
  }

  .nav-link {
    font-size: 1rem;
  }
}
