/* ============================================================
   O DIÁRIO DA MADRUGADA - kyxen
   zine editorial · lo-fi madrugada
   papel escuro quente · tinta âmbar · serif + mono
   ============================================================ */

:root {
  --paper: #16130e;
  --paper-2: #1c1811;
  --paper-3: #221d14;
  --ink: #e9e1cf;
  --ink-dim: #a89e8a;
  --ink-faint: #8a7f6d;
  --amber: #d8a75c;
  --amber-soft: #e6bd7c;
  --line: rgba(233, 225, 207, 0.14);
  --line-soft: rgba(233, 225, 207, 0.08);
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --maxw: 62rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press: 130ms;
  --dur-hover: 200ms;
  --dur-reveal: 600ms;
  --dur-eq: 1.4s;
}

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

html {
  color-scheme: dark;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(216, 167, 92, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(216, 167, 92, 0.04), transparent 60%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* luz de abajur atrás do herói */
.lamp-glow {
  position: fixed;
  top: -30%;
  left: 55%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(216, 167, 92, 0.1) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- mono helpers ---------- */
.mono { font-family: var(--mono); }
.micro { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; }
.dim { color: var(--ink-dim); }

/* ---------- masthead ---------- */
.masthead {
  padding-top: 2rem;
  padding-bottom: 1.5rem;
}

.masthead-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-dim);
  padding-bottom: 0.75rem;
}

.masthead-rule {
  border-top: 1px solid var(--line);
}

.masthead-rule.thick {
  margin-top: 0.35rem;
  border-top-width: 2px;
}

.masthead-title-wrap {
  padding: 1.25rem 0;
  text-align: center;
}

.masthead-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.masthead-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--amber);
}

.masthead-sub {
  margin-top: 0.6rem;
  color: var(--ink-dim);
}

/* ---------- reveal (scroll) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--index, 0) * 80ms);
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 2fr);
  gap: 3rem;
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.ghost-num {
  position: absolute;
  top: 0.5rem;
  right: -0.25rem;
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(5rem, 14vw, 9rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(216, 167, 92, 0.18);
  user-select: none;
  pointer-events: none;
}

.kicker {
  color: var(--amber);
  margin-bottom: 0.9rem;
}

.hero-title {
  font-weight: 300;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.hero-title em {
  font-style: italic;
  color: var(--amber-soft);
}

.hero-sub {
  margin-top: 1rem;
  max-width: 42ch;
  color: var(--ink-dim);
  font-size: 1.12rem;
}

.hero .meta {
  margin-top: 1.05rem;
  color: var(--ink-faint);
}

.hero-cta {
  display: inline-block;
  margin-top: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.5rem 1.1rem;
  color: var(--amber);
  text-decoration: none;
  font-size: 0.8rem;
  transition: border-color var(--dur-hover) ease, color var(--dur-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
  .hero-cta:hover {
    border-color: rgba(216, 167, 92, 0.5);
    color: var(--amber-soft);
  }
}

.hero-cta:active {
  transform: translateY(0);
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: flex-end;
  padding-bottom: 0.5rem;
  border-left: 1px solid var(--line-soft);
  padding-left: 1.5rem;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--amber);
  margin-bottom: 0.4rem;
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.eq i {
  display: block;
  width: 3px;
  height: 100%;
  background: currentColor;
  transform-origin: bottom;
  animation: eq var(--dur-eq) ease-in-out infinite;
}

.eq i:nth-child(1) { animation-delay: 0s; }
.eq i:nth-child(2) { animation-delay: 0.2s; }
.eq i:nth-child(3) { animation-delay: 0.4s; }
.eq i:nth-child(4) { animation-delay: 0.1s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}

.side-line { color: var(--ink); }
.side-line.dim { color: var(--ink-dim); }

.hero-rule {
  border-top: 1px solid var(--line-soft);
  margin: 0.75rem 0;
}

/* ---------- sections ---------- */
.section-rule {
  border: none;
  border-top: 1px solid var(--line);
}

.column {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-label {
  color: var(--amber);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- prestação de serviços ---------- */
.ad-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.ad-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.avail {
  color: var(--amber);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.ad-title {
  font-weight: 400;
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  max-width: 26ch;
}

.ad-title em {
  font-style: italic;
  color: var(--amber-soft);
}

.ad-body {
  margin-top: 0.9rem;
  max-width: 58ch;
  color: var(--ink-dim);
}

.ad-services {
  list-style: none;
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 2rem;
}

.ad-services li {
  color: var(--ink);
  font-size: 0.8rem;
}

.ad-services li span {
  color: var(--amber);
  margin-right: 0.5rem;
}

.ad-foot {
  margin-top: 1.5rem;
}

.ad-cta {
  display: inline-block;
  margin-top: 1.25rem;
  border: 1px solid rgba(216, 167, 92, 0.45);
  border-radius: 4px;
  padding: 0.6rem 1.1rem;
  color: var(--amber);
  text-decoration: none;
  font-size: 0.8rem;
  transition: border-color var(--dur-hover) ease, background-color var(--dur-hover) ease, color var(--dur-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
  .ad-cta:hover {
    border-color: rgba(216, 167, 92, 0.8);
    background-color: rgba(216, 167, 92, 0.08);
    color: var(--amber-soft);
  }
}

.ad-cta:active {
  transform: translateY(0);
  transition-duration: var(--dur-press);
}

/* ---------- o autor ---------- */
.column-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
  gap: 3rem;
  align-items: start;
}

.prose p {
  margin-bottom: 1.1rem;
  max-width: 60ch;
  color: var(--ink-dim);
}

.pullquote {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.25;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 1.5rem;
  max-width: 22ch;
}

.cert-img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  filter: sepia(0.35) saturate(0.85) brightness(0.92);
}

.cert figcaption {
  margin-top: 0.5rem;
}

/* ---------- arquivo ---------- */
.archive {
  list-style: none;
  border-top: 1px solid var(--line);
}

.arch-item {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: baseline;
  padding: 1.1rem 0.25rem;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color var(--dur-hover) ease;
}

.arch-item:hover {
  background-color: rgba(216, 167, 92, 0.04);
}

.arch-no {
  color: var(--ink-faint);
}

.arch-title {
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.arch-desc {
  margin-top: 0.2rem;
  color: var(--ink-dim);
  font-size: 0.8rem;
}

.arch-tags {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.arch-tag {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
}

.arch-link {
  color: var(--amber);
  font-size: 0.8rem;
  white-space: nowrap;
  text-decoration: none;
}

.arch-link:hover {
  color: var(--amber-soft);
}

/* ---------- apontamentos ---------- */
.notebook {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  padding: 0.4rem 1.5rem;
}

.note-row {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.note-row:last-child {
  border-bottom: none;
}

.note-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.note-desc {
  font-size: 0.8rem;
  color: var(--ink-dim);
  line-height: 1.3;
}

.note-desc::before {
  content: "- ";
  color: var(--amber);
}

/* ---------- colofão ---------- */
.colophon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.colophon-item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem 1.4rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-2);
  transition:
    border-color var(--dur-hover) ease,
    transform var(--dur-hover) ease;
}

@media (hover: hover) and (pointer: fine) {
  .colophon-item:hover {
    border-color: rgba(216, 167, 92, 0.5);
    transform: translateY(-2px);
  }
}

.colophon-item:active {
  transform: translateY(0);
  transition-duration: var(--dur-press);
}

.colophon-value {
  font-size: 0.95rem;
  color: var(--ink);
}

.colophon-item .arrow {
  color: var(--amber);
}

/* ---------- terminal ---------- */
.terminal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.tdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tdot-a { background: #a46a4a; }
.tdot-b { background: #9a8a5f; }
.tdot-c { background: #6f7657; }

.terminal-title {
  margin-left: auto;
  color: var(--ink-faint);
  text-transform: none;
  letter-spacing: 0;
}

.terminal-out {
  padding: 1.1rem 1.1rem 0.4rem;
  min-height: 6rem;
  max-height: 20rem;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.65;
}

.term-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.term-line.err { color: #c9826a; }
.term-line.ok { color: var(--amber-soft); }
.term-line.dim { color: var(--ink-dim); }

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1.1rem 1.1rem;
}

.terminal-prompt {
  color: var(--amber);
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-size: 0.82rem;
  caret-color: var(--amber);
}

.terminal-input::placeholder {
  color: var(--ink-faint);
}

/* ---------- footer ---------- */
.colophon-footer {
  padding: 1.5rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  text-align: center;
}

/* ---------- foco ---------- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 2px;
}

a {
  color: var(--amber);
}

/* ---------- reduzir movimento: mais suave, sem deslocamento ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.2s ease;
  }
  .colophon-item:active,
  .colophon-item:hover {
    transform: none;
  }
  .eq i {
    animation: none;
  }
  .pulse-dot {
    animation: none;
    opacity: 1;
  }
  * {
    scroll-behavior: auto !important;
  }
}

/* ---------- responsivo ---------- */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-side {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-left: none;
    padding-left: 0;
    gap: 0.6rem;
  }
  .hero-rule { display: none; }
  .column-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .colophon {
    grid-template-columns: 1fr;
  }
  .ad-services {
    grid-template-columns: 1fr;
  }
  .arch-item {
    grid-template-columns: 2.25rem minmax(0, 1fr);
  }
  .arch-link {
    grid-column: 2;
  }
  .note-row {
    grid-template-columns: 7rem minmax(0, 1fr);
  }
  .hide-mobile {
    display: none;
  }
}
