/* ==========================================================================
   base.css — base compartida de escribanoclemente.com
   Extraída tal cual del <style> inline de /i (mismo orden de cascada, mismas
   reglas): tokens :root, reset, html/body, enlaces, contenedor y su velo
   superior, .article, .basic-link, .post-list, pie y conejo.
   La usan /i (con i.css) y las páginas de trabajo (con trabajo.css).
   No añadas aquí nada que no esté en /i: rompería su identidad visual.
   ========================================================================== */

/* minireset.css v0.0.6 | MIT License */
blockquote,body,dd,dl,dt,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,html,iframe,legend,li,ol,p,pre,textarea,ul{margin:0;padding:0}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}
ul{list-style:none}
button,input,select{margin:0}
html{box-sizing:border-box}
*,:after,:before{box-sizing:inherit}
img,video{height:auto;max-width:100%}

:root {
  --duration-snappy: 220ms;
  --ease-snappy: cubic-bezier(0.175, 0.885, 0.32, 1.1);
  --duration-swift: 800ms;
  --ease-swift: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --duration-smooth: 300ms;
  --ease-smooth: cubic-bezier(0.19, 1, 0.22, 1);
  --font-fallback: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-primary: "Inter", var(--font-fallback);
  --font-secondary: "Newsreader", Georgia, serif;
  --font-code: "SF Mono", "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, Courier, monospace;
  --font-body: var(--font-primary);
  --body-color: #111;
  --body-bg: #fdfdfc;
  /* Atenuado legible (5,71:1 sobre --body-bg): el mismo token que usan los
     trabajos para el pie y los textos secundarios. En /i solo lo usa el reloj
     del pie, que con el 40 % de negro se quedaba en 2,84:1. */
  --mute-read: rgba(0, 0, 0, 0.6);
  --heading-color: #111;
  --hyperlink-color: #3e9fff;
  --focus-color: rgba(0, 122, 255, 0.5);
  --selection-color: #111;
  --selection-bg: #ededed;
}

* {
  outline: 0;
  padding: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 100px; }
:hover::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); }

::selection { color: var(--selection-color); background: var(--selection-bg); }
::-moz-selection { color: var(--selection-color); background: var(--selection-bg); }
:focus-visible { outline: 2px solid var(--focus-color); }

html {
  background: var(--body-bg);
  color: var(--body-color);
  scroll-behavior: smooth;
  scroll-padding-top: 5.25rem;
  overflow-anchor: none;
  min-height: 100%;
}

body {
  min-height: 100%;
  overflow-y: scroll;
  font-size: 16px;
  line-height: 1.5;
  text-align: start;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  text-size-adjust: none;
  font-family: var(--font-primary);
  font-variation-settings: "wght" 460;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Main Container & Top Gradient Veil */
.container {
  padding: 5rem 1rem 2.5rem;
  max-width: 36.375rem;
  margin: 0 auto;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 2rem 1.5rem 2.5rem;
  }
}

.container::before {
  content: "";
  pointer-events: none;
  z-index: 9;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(
    180deg,
    #fdfdfc 0,
    hsla(60, 14%, 99%, 0.738) 19%,
    hsla(60, 14%, 99%, 0.541) 34%,
    hsla(60, 14%, 99%, 0.382) 47%,
    hsla(60, 14%, 99%, 0.278) 56.5%,
    hsla(60, 14%, 99%, 0.194) 65%,
    hsla(60, 14%, 99%, 0.126) 73%,
    hsla(60, 14%, 99%, 0.075) 80.2%,
    hsla(60, 14%, 99%, 0.042) 86.1%,
    hsla(60, 14%, 99%, 0.021) 91%,
    hsla(60, 14%, 99%, 0.008) 95.2%,
    hsla(60, 14%, 99%, 0.002) 98.2%,
    hsla(60, 14%, 99%, 0)
  );
}

@media screen and (max-width: 768px) {
  .container::before {
    height: 2.5rem;
  }
}

/* Article & Typography */
.article {
  max-width: 70ch;
}

.article > header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0 0.5rem;
}

.article > header h1,
.article > header time {
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: -0.00563rem;
}

.article > header h1 {
  color: #111;
  font-weight: 500;
  font-variation-settings: "wght" 500;
  text-wrap: balance;
}

.article > header time {
  color: rgba(0, 0, 0, 0.4);
  font-weight: 460;
  font-variation-settings: "wght" 460;
}

.article > p {
  padding-top: 1rem;
  font-size: 0.875rem;
  font-weight: 460;
  font-variation-settings: "wght" 460;
  line-height: 1.25rem;
  letter-spacing: -0.00563rem;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.article em {
  color: #000;
  font-family: var(--font-secondary);
  font-size: 0.9375rem;
  font-style: italic;
  font-weight: 430;
  letter-spacing: 0.01rem;
  font-variation-settings: "opsz" 10;
  line-height: 1;
}

/* Basic Link (Subtle Animated Underline) */
.basic-link {
  position: relative;
  display: inline;
  color: inherit;
  font-weight: inherit;
  line-height: inherit;
  transition: all 0.2s ease;
}

.basic-link::before {
  pointer-events: none;
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  border-radius: 2px;
  background: #d9d9d9;
  opacity: 1;
  transition: inherit;
}

.basic-link:hover::before {
  background: #666;
}

.basic-link:focus-visible {
  border-radius: 2px;
  padding: 0 2px;
  margin: 0 -2px;
  transition: none;
  outline: 2px solid var(--focus-color);
}

/* Post / Project / Experience List Section */
.post-list {
  padding: 3rem 0 0;
}

.post-list-title {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  font-weight: 460;
  font-variation-settings: "wght" 460;
  letter-spacing: -0.00563rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f2f2f2;
  text-wrap: balance;
}

.post-list > ul {
  display: flex;
  flex-direction: column;
  list-style: none;
}

@media screen and (min-width: 520px) {
  .post-list > ul:hover > li > ul > li > a h2,
  .post-list > ul:hover > li > ul > li > a time span {
    opacity: 0.3;
  }
  .post-list > ul:hover > li > ul > li > a time span:last-child {
    opacity: 1;
  }
}

.post-list > ul > li {
  border-bottom: 1px solid #f2f2f2;
}

.post-list > ul > li:last-child {
  border-bottom: none;
}

.post-list > ul > li > ul {
  display: flex;
  flex-direction: column;
  list-style: none;
}

.post-list > ul > li > ul > li:last-child > a::after {
  display: none;
}

.post-list > ul > li > ul > li:first-child > a > time > span:last-child {
  visibility: visible;
}

.post-list > ul > li > ul > li > a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.735rem 0 0.735rem 6.75rem;
}

@media screen and (max-width: 520px) {
  .post-list > ul > li > ul > li > a {
    padding-left: 3.75rem;
  }
}

.post-list > ul > li > ul > li > a:hover h2,
.post-list > ul > li > ul > li > a:hover time span {
  opacity: 1;
}

.post-list > ul > li > ul > li > a::after {
  content: "";
  border-bottom: 1px solid #f2f2f2;
  position: absolute;
  bottom: 0;
  left: 6.75rem;
  right: 0;
}

@media screen and (max-width: 520px) {
  .post-list > ul > li > ul > li > a::after {
    left: 3.75rem;
  }
}

.post-list > ul > li > ul > li > a h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #111;
  font-size: 0.875rem;
  font-weight: 460;
  font-variation-settings: "wght" 460;
  letter-spacing: -0.00563rem;
  transition: opacity 0.14s ease;
}

.post-list > ul > li > ul > li > a h2 .role-muted {
  color: rgba(0, 0, 0, 0.4);
  font-weight: 460;
}

.post-list > ul > li > ul > li > a time {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.875rem;
  font-weight: 460;
  font-variation-settings: "wght" 460;
  line-height: normal;
  letter-spacing: -0.00563rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-list > ul > li > ul > li > a time span {
  transition: opacity 0.14s ease;
  display: inline-block;
}

.post-list > ul > li > ul > li > a time span:nth-child(2) {
  position: absolute;
  width: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
}

.post-list > ul > li > ul > li > a time span:last-child {
  visibility: hidden;
  position: absolute;
  left: 0;
}

/* Footer */
.footer {
  padding: 2.5rem 0 5rem;
}

.footer-container {
  max-width: 36.375rem;
  margin: 0 auto;
}

.footer-container::before {
  content: "";
  display: block;
  height: 1px;
  width: 3.125rem;
  background: #ededed;
  margin: 0 0 2.375rem;
}

.footer-container p {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.8125rem;
  font-weight: 460;
  font-variation-settings: "wght" 460;
  letter-spacing: -0.0025rem;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-link {
  color: rgba(0, 0, 0, 0.4);
  font-size: 0.8125rem;
  font-weight: 460;
  letter-spacing: -0.0025rem;
  transition: opacity 0.15s ease;
}

.footer-link:hover {
  opacity: 0.5;
}

/* Bunny Animations */
.footer-ear-left-awake,
.footer-ear-right-awake {
  transform-origin: bottom center;
  transform-box: fill-box;
}

@keyframes awakeLeftEarTwitch {
  0%, 9% { transform: rotate(0deg); }
  12% { transform: rotate(-8deg); }
  16%, 34% { transform: rotate(0deg); }
  38% { transform: rotate(-12deg); }
  42% { transform: rotate(-6deg); }
  48%, 58% { transform: rotate(0deg); }
  62% { transform: rotate(-30deg); }
  70% { transform: rotate(-28deg); }
  78%, 100% { transform: rotate(0deg); }
}

@keyframes awakeRightEarTwitch {
  0%, 9% { transform: rotate(0deg); }
  12% { transform: rotate(6deg); }
  16%, 34% { transform: rotate(0deg); }
  38% { transform: rotate(10deg); }
  42% { transform: rotate(4deg); }
  48%, 58% { transform: rotate(0deg); }
  62% { transform: rotate(-30deg); }
  70% { transform: rotate(-28deg); }
  78%, 100% { transform: rotate(0deg); }
}

@keyframes eyeBlinkLeft {
  0%, 19%, 23%, 50%, 54%, 100% { transform: translate(0, 0) scaleY(1); }
  21%, 52% { transform: translate(0, 0) scaleY(0.1); }
  40% { transform: translate(-1px, -0.6px) scaleY(1); }
  75% { transform: translate(-0.5px, 0.5px) scaleY(1); }
}

@keyframes eyeBlinkRight {
  0%, 19%, 23%, 50%, 54%, 100% { transform: translate(0, 0) scaleY(1); }
  21%, 52% { transform: translate(0, 0) scaleY(0.1); }
  40% { transform: translate(-1.5px, -0.6px) scaleY(1); }
  75% { transform: translate(-1px, 0.5px) scaleY(1); }
}

.bunny-awake .footer-ear-left-awake {
  animation: awakeLeftEarTwitch 12s ease-in-out infinite;
}

.bunny-awake .footer-ear-right-awake {
  animation: awakeRightEarTwitch 12s ease-in-out infinite;
}

.bunny-awake .eye-left {
  transform-origin: center;
  transform-box: fill-box;
  animation: eyeBlinkLeft 5s ease-in-out infinite;
}

.bunny-awake .eye-right {
  transform-origin: center;
  transform-box: fill-box;
  animation: eyeBlinkRight 5s ease-in-out infinite;
}

@keyframes zFloat1 {
  0% { transform: translate(0, 0) scale(0.7); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(4px, -14px) scale(1); opacity: 0; }
}

@keyframes zFloat2 {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(6px, -16px) scale(0.9); opacity: 0; }
}

@keyframes zFloat3 {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(8px, -18px) scale(0.8); opacity: 0; }
}

.bunny-toggle {
  display: inline-block;
  vertical-align: bottom;
  margin-bottom: -6px;
  cursor: pointer;
  user-select: none;
}
