/* [edr] — site público */

:root {
  --bg: #000;
  --fg: #fff;
  --muted: #8a8a8a;
  --field: #222;
  --gutter: 16px;
  --grid-gap: 6px; /* espaço entre trabalhos na grelha */
  --font-mono: Consolas, "Inconsolata", ui-monospace, "SF Mono", Menlo, monospace;
  --font-logo: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav-size: 20px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--nav-size);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- header / footer ---------- */

.site-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 28px 22px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.logo {
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin-right: 58px;
}
.logo:hover { text-decoration: none; opacity: .7; }

.nav { display: flex; gap: 34px; }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

.header-title {
  margin: 0 0 0 auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-footer {
  margin-top: auto;
  padding: 120px var(--gutter) 24px;
  text-align: center;
  font-size: 15px;
}
.site-footer p { margin: 0; }
.site-credit { margin-top: 6px !important; font-size: 12px; color: var(--muted); }
.site-credit a { text-decoration: underline; text-underline-offset: 3px; }
.site-credit a:hover { color: var(--fg); }

/* ---------- home ---------- */

.page-home { justify-content: center; }

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.home-logo {
  margin: 0;
  font-family: var(--font-logo);
  font-weight: 600;
  font-size: clamp(96px, 20vw, 290px);
  line-height: .9;
  letter-spacing: -0.03em;
}

.home-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
  font-size: 24px;
}

.home-corner {
  position: fixed;
  bottom: 22px;
  margin: 0;
  font-size: 16px;
}
.home-location { left: 18px; }
.home-clock { right: 28px; font-variant-numeric: tabular-nums; }

/* ---------- grelha (works / archive) ---------- */

.grid-wrap { padding: 0 var(--gutter); }

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3;
  column-gap: var(--grid-gap);
}

.grid-item {
  break-inside: avoid;
  margin-bottom: var(--grid-gap);
}

.grid-item a { display: block; position: relative; }
.grid-item a:hover, .grid-item a:focus-visible { text-decoration: none; }

.grid-item img { width: 100%; transition: filter .25s ease; }

.grid-item a:hover img,
.grid-item a:focus-visible img { filter: brightness(.35); }

/* Título ao centro no toque/teclado; em rato é substituído pela etiqueta que segue o cursor. */
.grid-label {
  position: absolute;
  inset: 50% 0 auto;
  transform: translateY(-50%);
  text-align: center;
  padding: 0 12px;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.grid-item a:focus-visible .grid-label { opacity: 1; }
@media (hover: none) {
  .grid-label { display: none; }
}

.cursor-label {
  position: fixed;
  left: 0; top: 0;
  z-index: 20;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -130%);
  transition: opacity .15s ease;
}
.cursor-label.is-visible { opacity: 1; }

.empty { padding: 80px var(--gutter); text-align: center; color: var(--muted); }

/* ---------- página de trabalho ---------- */

.work { padding: 0 var(--gutter); }

.work-info {
  max-width: 860px;
  margin: 0 0 48px;
  padding: 24px 20px 0;
  line-height: 1.25;
}
.work-info p { margin: 0 0 1em; }
.work-meta { color: var(--muted); }

.work-images { display: flex; flex-direction: column; gap: var(--gutter); }
.work-images figure { margin: 0; }
.work-images img { width: 100%; }
.work-images figcaption { padding: 10px 4px 0; font-size: 15px; color: var(--muted); }

.work-next { padding: 64px 4px 0; text-align: right; }

/* ---------- about ---------- */

.about {
  padding: 110px 36px 0;
  max-width: 920px;
  font-size: clamp(20px, 2.1vw, 31px);
  line-height: 1.16;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.about-text p { margin: 0 0 1.16em; white-space: pre-line; }
.about-links { list-style: none; margin: 0; padding: 0; }

/* ---------- archive (password) ---------- */

.lock {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.lock-form { position: relative; }

.lock-form input {
  width: 264px;
  max-width: 100%;
  height: 40px;
  border: 0;
  border-radius: 0;
  background: var(--field);
  color: var(--fg);
  font: inherit;
  font-size: 22px;
  text-align: center;
  letter-spacing: .1em;
}
.lock-form input::placeholder { color: var(--fg); opacity: 1; }
.lock-form input:focus::placeholder { opacity: .3; }
.lock-form input:focus { outline: 1px solid #555; }

.lock-msg {
  position: absolute;
  left: 0; right: 0;
  margin: 14px 0 0;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

.is-error input { animation: shake .35s ease; }
@keyframes shake {
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

.not-found { font-size: inherit; font-weight: 400; }

/* ---------- responsivo ---------- */

@media (max-width: 1000px) {
  .grid { columns: 2; }
}

@media (max-width: 700px) {
  :root { --nav-size: 16px; }
  .site-header { flex-wrap: wrap; padding: 14px var(--gutter) 16px; row-gap: 6px; }
  .logo { font-size: 24px; margin-right: 12px; }
  .nav { gap: 14px; }
  .header-title { flex-basis: 100%; margin: 0; text-align: left; color: var(--muted); }
  .grid { columns: 1; }
  .about { padding: 48px var(--gutter) 0; }
  .work-info { padding: 12px 0 0; margin-bottom: 32px; }
  .home-nav { font-size: 20px; }
  .home-corner { font-size: 13px; bottom: 16px; }
  .home-location { left: var(--gutter); }
  .home-clock { right: var(--gutter); }
  .site-footer { padding-top: 72px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
