@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400&display=swap');
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #eeeeee;
  --text: #111;
  --text-dim: #aaa;
  --tag-bg: #fff;
}
[data-theme="dark"] {
  --bg: #252525;
  --text: #fff;
  --text-dim: #666;
  --tag-bg: #000;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #252525;
    --text: #fff;
    --text-dim: #666;
    --tag-bg: #000;
  }
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* NAV — 16px @ 1920 = 0.833vw */
.nav-items {
  position: fixed;
  top: 36px;
  right: 36px;
  display: flex;
  gap: 48px;
  font-size: clamp(14px, 0.833vw, 16px);
  z-index: 20;
  transition: opacity 0.4s ease;
}
.nav-items a { color: var(--text); text-decoration: none; cursor: pointer; }
.nav-items a:hover { text-decoration: underline; }
.nav-lang { cursor: pointer; user-select: none; color: var(--text); }
.active-lang { text-decoration: underline !important; }
.active-page { text-decoration: underline !important; }

/* LOGO — 238px @ 1920 = 12.4vw */
.site-logo {
  position: fixed;
  top: 22px;
  left: 17px;
  width: clamp(200px, 12.4vw, 238px);
  z-index: 50;
  transition: opacity 0.4s ease;
}
.site-logo img { width: 100%; height: auto; display: block; }

#logo-click {
  position: fixed;
  top: 22px;
  left: 17px;
  width: clamp(200px, 12.4vw, 238px);
  height: clamp(50px, 4.17vw, 80px);
  z-index: 100;
  cursor: crosshair;
}

/* ABOUT */
.about-block {
  position: fixed;
  top: 36px;
  left: 36px;
  width: 60%;
  z-index: 25;
  overflow: visible;
}
/* 214px @ 1920 = 11.15vw */
.about-logo-space {
  display: inline-block;
  width: clamp(180px, 11.15vw, 214px);
  height: 1px;
}
/* 48px @ 1920 = 2.5vw */
.about-desc {
  font-size: clamp(40px, 2.5vw, 48px);
  line-height: 1.167;
  font-weight: 400;
}
.sub-wrap {
  margin-top: 56px;
  display: flex;
  align-items: baseline;
  gap: 0;
  font-size: clamp(40px, 2.5vw, 48px);
  line-height: 1.167;
  font-weight: 400;
  white-space: nowrap;
  overflow: visible;
  width: max-content;
}
#sub-btn { cursor: pointer; font-size: clamp(40px, 2.5vw, 48px); color: var(--text); }
.sub-confirm { font-size: clamp(40px, 2.5vw, 48px); line-height: 1.167; font-weight: 400; margin-top: 56px; display: none; }

/* ARCHIVE */
.archive-title {
  position: fixed;
  top: 36px;
  left: 36px;
  font-size: clamp(40px, 2.5vw, 48px);
  line-height: 1.167;
  font-weight: 400;
  z-index: 15;
  transition: opacity 0.4s ease;
}
/* 214px @ 1920 = 11.15vw */
.archive-title-space {
  display: inline-block;
  width: clamp(180px, 11.15vw, 214px);
  height: 1px;
}
/* 10px @ 1920 = 0.52vw */
.archive-tags {
  position: absolute;
  top: 262px;
  left: 36px;
  display: flex;
  gap: 8px;
  font-size: clamp(9px, 0.52vw, 10px);
  z-index: 20;
  font-weight: 400;
}
.archive-tag {
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  text-decoration: none;
  background: var(--tag-bg);
  border: 1px solid transparent;
  padding: 4px 10px;
  display: inline-block;
}
.archive-tag:hover { opacity: 0.7; }
.archive-tag.active { border-color: var(--text); }
.archive-block {
  padding-top: 294px;
  padding-left: 36px;
  padding-right: 36px;
  padding-bottom: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}
.archive-block .archive-list { flex: 1; }
.archive-list { list-style: none; }
/* 48px @ 1920 = 2.5vw */
.archive-item { font-size: clamp(40px, 2.5vw, 48px); line-height: 1.167; font-weight: 400; margin-bottom: 8px; }
.archive-item-date {
  font-size: clamp(14px, 0.833vw, 16px);
  font-weight: 400;
  color: var(--text);
  margin-left: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}
.archive-item:hover .archive-item-date { opacity: 1; }
.archive-item a { color: var(--text); text-decoration: none; cursor: pointer; }
.archive-item a:hover { text-decoration: underline; }
.archive-item a.visited { color: var(--text-dim); }

/* 260px @ 1920 = 13.54vw */
.arch-img {
  position: fixed;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  width: clamp(160px, 13.54vw, 260px);
  height: auto;
}
.arch-img.visible { opacity: 1; }

/* ARTICLE TAGS */
.art-tag-wrap {
  position: relative;
  margin-bottom: 12px;
  z-index: 10;
}
/* 10px @ 1920 = 0.52vw */
.art-tag {
  display: inline-block;
  font-size: clamp(9px, 0.52vw, 10px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--tag-bg);
  border: none;
  padding: 4px 10px;
  color: var(--text);
  text-decoration: none;
  margin-left: 6px;
}
.art-tag:hover { opacity: 0.7; }

/* ARTICLE */
.art-flow { padding: 0 36px 60px; min-height: 100vh; }
.art-img-wrap { margin-bottom: -12px; padding-left: 60px; }
/* 362px @ 1920 = 18.85vw */
.art-img-wrap img { height: clamp(300px, 18.85vw, 362px); width: auto; display: block; }
/* 16px @ 1920 = 0.833vw */
.art-date { font-size: clamp(14px, 0.833vw, 16px); font-weight: 400; color: var(--text); margin-left: 16px; }
/* 64px @ 1920 = 3.33vw */
.art-title { display: inline; font-size: clamp(54px, 3.33vw, 64px); line-height: 1.0; font-weight: 400; letter-spacing: -0.1vw; }
.art-title-wrap { width: 60%; margin-bottom: 36px; }
/* 43px @ 1920 = 2.24vw */
.art-body { font-size: clamp(36px, 2.24vw, 43px); line-height: 1.4; font-weight: 400; width: 72%; }
.art-body p { text-indent: 60px; }
.art-nav {
  display: flex;
  justify-content: space-between;
  padding-top: 36px;
  padding-bottom: 36px;
  width: 72%;
  overflow: visible;
  position: relative;
}
/* 10px @ 1920 = 0.52vw */
.art-nav-item {
  cursor: pointer;
  color: var(--text);
  font-size: clamp(9px, 0.52vw, 10px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--tag-bg);
  border: none;
  padding: 4px 10px;
  display: inline-block;
  position: static;
  text-decoration: none;
}
.art-nav-item.inactive {
  color: var(--text-dim);
  cursor: default;
  pointer-events: none;
}
.art-nav-item:hover .art-nav-tooltip { opacity: 1; }
/* 43px @ 1920 = 2.24vw */
.art-nav-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  text-decoration: underline;
  font-size: clamp(28px, 2.24vw, 43px);
  line-height: 1.1;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  white-space: normal;
  max-width: 65vw;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  background: none;
  border: none;
  padding: 0;
}
.art-nav-prev:hover .art-nav-tooltip { opacity: 1; }
.art-nav-next:hover .art-nav-tooltip { opacity: 1; }
.art-nav-next .art-nav-tooltip { left: auto; right: 0; text-align: right; }

/* PRIVACY */
.privacy-block { padding: 0 0 60px; width: 72%; }
/* 32px @ 1920 = 1.67vw */
.privacy-text { font-size: clamp(26px, 1.67vw, 32px); line-height: 1.2; font-weight: 400; color: var(--text); margin-bottom: 16px; }
.privacy-text a { color: var(--text); }

/* FOOTER — 12px @ 1920 = 0.625vw */
.page-footer {
  padding: 60px 0 36px;
  font-size: clamp(10px, 0.625vw, 12px);
  text-align: right;
}
.page-footer a { color: var(--text); text-decoration: none; cursor: pointer; }
.page-footer a:hover { text-decoration: underline; }

.footer-fixed {
  position: fixed;
  bottom: 36px;
  right: 36px;
  font-size: clamp(10px, 0.625vw, 12px);
}
.footer-fixed a { color: var(--text); text-decoration: none; cursor: pointer; }
.footer-fixed a:hover { text-decoration: underline; }

/* ============================================
   RESPONSIVE MOBILE — max-width: 768px
   ============================================ */
@media (max-width: 768px) {

  body {
    overflow-x: hidden;
    width: 100%;
  }

  .nav-items {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    gap: 0;
    font-size: 3.2vw;
    background: var(--bg);
    z-index: 9999;
    box-sizing: border-box;
    white-space: nowrap;
    transition: none;
  }

}

/* Privacy link — mobile only */
.nav-privacy-mobile { display: none; }
@media (max-width: 768px) {
  .nav-privacy-mobile { display: inline; }
}

@media (max-width: 768px) {
  /* Hide fixed logo on article — logo will be part of content */
  #site-logo { display: none; }
  #logo-click { display: none; }
}

@media (max-width: 768px) {
  .art-nav-tooltip { display: none; }
  .art-flow { overflow: hidden; }
}

/* About mobile */
.about-logo-mobile { display: none; }
@media (max-width: 768px) {
  #site-logo {
    display: block !important;
    width: 167px !important;
    top: 44px !important;
    left: 6px !important;
  }
  #logo-click {
    display: none;
  }
  .about-block {
    top: 54px !important;
    left: 20px !important;
    width: calc(100% - 40px) !important;
  }
  .about-logo-space {
    width: 150px !important;
  }
  .about-desc {
    font-size: 32px !important;
    line-height: 1.2 !important;
  }
  .sub-wrap {
    margin-top: 32px;
    font-size: 32px !important;
    white-space: normal !important;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 0 !important;
  }
  #sub-editor { font-size: 32px !important; white-space: normal !important; }
  #sub-btn { font-size: 32px !important; }
}

@media (max-width: 768px) {
  .sub-input-row {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
}

@media (max-width: 768px) {
  .footer-fixed { display: none; }
}

@media (max-width: 768px) {
  .archive-title {
    top: 54px !important;
    left: 20px !important;
    font-size: 32px !important;
  }
  .archive-title-space {
    width: 150px !important;
  }
}

@media (max-width: 768px) {
  .archive-tags {
    top: 133px;
    left: 20px;
    font-size: 10px;
  }
  .archive-block {
    padding-top: 170px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .archive-item {
    font-size: 24px;
    line-height: 1.167;
  }
}

@media (max-width: 768px) {
  .sub-confirm {
    font-size: 32px !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 768px) {
  .archive-item {
    margin-bottom: 16px;
  }
}

@media (max-width: 768px) {
  .archive-item-date { display: none; }
}

@media (max-width: 768px) {
  /* Logo and archive title scroll with content on mobile — not on about page */
  body:not(.about-page) #site-logo {
    position: absolute !important;
  }
  .archive-title {
    position: absolute !important;
  }
  /* Hide privacy footer in archive on mobile */
  .page-footer { display: none; }
}

@media (max-width: 768px) {
  .archive-tags {
    overflow-x: auto;
    overflow-y: visible;
    flex-wrap: nowrap;
    padding-right: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .archive-tags::-webkit-scrollbar { display: none; }
}

@media (max-width: 768px) {
  .archive-tags {
    width: calc(100vw);
    left: 0 !important;
    padding-left: 10px;
  }
}

@media (max-width: 768px) {
  .art-flow {
    padding: 0;
    overflow: hidden;
  }
  .art-img-wrap {
    padding-left: 0;
    margin: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 39px;
  }
  .art-img-wrap img {
    height: 260px;
    width: auto;
    display: block;
  }
}

@media (max-width: 768px) {
  /* Tags */
  .art-tag-wrap {
    margin-bottom: 0;
    margin-left: 10px;
    margin-top: -14px;
  }
  .art-tag {
    margin-left: 0;
    font-size: 10px;
  }
  /* Title and body */
  .art-title-wrap {
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    margin-bottom: 20px;
  }
  .art-title {
    font-size: 42px !important;
    letter-spacing: -1px;
  }
  .art-body {
    font-size: 24px !important;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
  }
  .art-body p { text-indent: 30px; }
}

@media (max-width: 768px) {
  /* Tag gap same as archive */
  #art-tag { display: flex; gap: 8px; flex-wrap: wrap; }
  /* Article line-height and hyphenation */
  .art-body {
    line-height: 1.2 !important;
    hyphens: auto;
    -webkit-hyphens: auto;
    word-break: break-word;
  }
  /* Nav anterior/siguiente full width */
  .art-nav {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
  .art-title-wrap {
    padding-top: 6px;
  }
}

@media (max-width: 768px) {
  .privacy-block {
    width: 100%;
    padding: 0 0 40px;
    box-sizing: border-box;
  }
  #privacy-title ~ .archive-block {
    padding-left: 10px;
    padding-right: 10px;
  }
  .privacy-text {
    font-size: 24px !important;
    line-height: 1.2 !important;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}

@media (max-width: 768px) {
  /* Privacy title scrolls with content on mobile */
  #privacy-title {
    position: absolute !important;
    top: 54px !important;
    left: 20px !important;
    font-size: 32px !important;
  }
}

@media (max-width: 768px) {
  /* Keep logo fixed on about page */
  .about-block ~ #site-logo,
  body:has(.about-block) #site-logo {
    position: fixed !important;
  }
}

@media (max-width: 768px) {
  .about-page { overflow: hidden; height: 100vh; }
}

.about-page #site-logo { position: fixed !important; }

/* Email input styling */
#sub-editor {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: clamp(40px, 2.5vw, 48px);
  font-weight: 400;
  padding: 0;
  min-width: 2px;
  cursor: text;
  vertical-align: baseline;
  min-width: 1em;
  display: inline-block;
}
#sub-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  pointer-events: none;
}
#sub-editor::placeholder { color: var(--text-dim); }
@media (max-width: 768px) {
  #sub-editor { font-size: 32px !important; width: 100%; }
}

.sub-input-row { cursor: text; }
.sub-input-row span[contenteditable] { cursor: text; }

@media (max-width: 768px) {
  .art-nav-item {
    text-align: center;
  }
}

.sub-lang {
  cursor: pointer;
  user-select: none;
  color: var(--text-dim) !important;
}
.sub-lang.active-sub-lang {
  color: var(--text) !important;
}
