/* ============================================================
   nolan-wolfe.com — a digital business card
   near-black, type-first, corner metadata, quiet luxury
   ============================================================ */

:root {
  --bg: #0d0d0e;
  --bg-raise: #151517;
  --ink: #ecebe8;
  --muted: #8c8b86;
  --hairline: rgba(236, 235, 232, 0.12);
  --accent: #d98e4a;
  --leica-red: #da291c;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;

  --space: clamp(1.25rem, 4vw, 3rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--muted) var(--bg);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }

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

em { font-family: var(--font-display); font-style: italic; font-size: 1.08em; }
.accent { color: var(--accent); }
.accent-red { color: var(--leica-red); font-style: normal; }

/* ---------- grain overlay ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 50;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 3%); }
  50%  { transform: translate(3%, -2%); }
  75%  { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

/* ---------- custom cursor ---------- */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
              background 0.25s, opacity 0.3s;
  opacity: 0;
  mix-blend-mode: difference;
}
.cursor.is-visible { opacity: 1; }
.cursor.is-hover { width: 44px; height: 44px; background: #fff; }
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- vertical scroll cue (espegren-style) ---------- */
.scroll-cue {
  position: fixed;
  right: calc(var(--space) * 0.75);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.6s, transform 0.6s var(--ease-out);
}
.scroll-cue__gap { height: 1.4rem; width: 1px; background: var(--hairline); }
.scroll-cue span:not(.scroll-cue__gap) {
  opacity: 0;
  animation: cue-in 0.5s var(--ease-out) forwards;
}
.scroll-cue span:nth-child(1)  { animation-delay: 1.0s; }
.scroll-cue span:nth-child(2)  { animation-delay: 1.06s; }
.scroll-cue span:nth-child(3)  { animation-delay: 1.12s; }
.scroll-cue span:nth-child(4)  { animation-delay: 1.18s; }
.scroll-cue span:nth-child(6)  { animation-delay: 1.3s; }
.scroll-cue span:nth-child(7)  { animation-delay: 1.36s; }
.scroll-cue span:nth-child(8)  { animation-delay: 1.42s; }
.scroll-cue span:nth-child(9)  { animation-delay: 1.48s; }
.scroll-cue span:nth-child(10) { animation-delay: 1.54s; }
.scroll-cue span:nth-child(11) { animation-delay: 1.6s; }
.scroll-cue span:nth-child(12) { animation-delay: 1.66s; }
.scroll-cue span:nth-child(13) { animation-delay: 1.72s; }
.scroll-cue span:nth-child(14) { animation-delay: 1.78s; }
@keyframes cue-in { to { opacity: 1; } }
.scroll-cue.is-hidden { opacity: 0; transform: translateY(-40%); pointer-events: none; }
@media (max-width: 640px) { .scroll-cue { display: none; } }

/* ---------- the card ---------- */
.card {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space);
}

.card__corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  animation: corner-in 1s var(--ease-out) 0.9s forwards;
}
.corner-label { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.14em; }
.card__corner--tl { top: var(--space); left: var(--space); }
.card__corner--tr { top: var(--space); right: var(--space); text-align: right; font-variant-numeric: tabular-nums; }
.card__corner--bl { bottom: var(--space); left: var(--space); }
.card__corner--br { bottom: var(--space); right: var(--space); text-align: right; }
@keyframes corner-in { to { opacity: 1; } }

@media (max-width: 640px) {
  .card__corner--tr, .card__corner--br { text-align: right; }
  .card__corner { font-size: 0.66rem; }
}

.card__center { text-align: center; }

.card__status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.75rem;
  opacity: 0;
  animation: corner-in 1s var(--ease-out) 0.7s forwards;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6fbf73;
  box-shadow: 0 0 0 0 rgba(111, 191, 115, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(111, 191, 115, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(111, 191, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 191, 115, 0); }
}

.card__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(4.5rem, 16vw, 13rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}

.line { display: block; overflow: hidden; }
.line__inner {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 1.1s var(--ease-out) forwards;
}
.card__name .line:nth-child(2) .line__inner { animation-delay: 0.12s; }

.card__role {
  margin-top: 1.6rem;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.card__role .line__inner { animation-delay: 0.3s; }

@keyframes rise { to { transform: translateY(0); } }

/* ---------- shared section shell ---------- */
main > section:not(.card), main > footer {
  padding: clamp(5rem, 14vh, 9rem) var(--space);
  max-width: 84rem;
  margin: 0 auto;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

/* ---------- work ---------- */
.work__list { list-style: none; border-top: 1px solid var(--hairline); }

.work__link {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto 2rem;
  align-items: baseline;
  gap: 1.5rem;
  padding: clamp(1.6rem, 4vh, 2.4rem) 0.5rem;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.35s, padding-left 0.35s var(--ease-out);
}
.work__link:hover { background: var(--bg-raise); padding-left: 1.25rem; }

.work__index {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.work__title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  transition: color 0.3s;
}
.work__link:hover .work__title { color: var(--accent); }
.work__desc {
  display: block;
  margin-top: 0.4rem;
  max-width: 32rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.work__tag {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.work__arrow {
  font-size: 1.3rem;
  color: var(--muted);
  transform: translate(-6px, 6px);
  opacity: 0;
  transition: transform 0.35s var(--ease-out), opacity 0.35s, color 0.3s;
}
.work__link:hover .work__arrow {
  transform: translate(0, 0);
  opacity: 1;
  color: var(--accent);
}

@media (max-width: 640px) {
  .work__link { grid-template-columns: 2rem 1fr; }
  .work__tag, .work__arrow { display: none; }
}

/* ---------- writing ---------- */
.writing__intro {
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  max-width: 38rem;
  margin-bottom: clamp(2rem, 5vh, 3rem);
}

.writing__list { list-style: none; border-top: 1px solid var(--hairline); }

.writing__item { border-bottom: 1px solid var(--hairline); }

.writing__link,
.writing__item--soon {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.4rem 0.5rem;
  transition: background 0.35s, padding-left 0.35s var(--ease-out);
}
.writing__link:hover { background: var(--bg-raise); padding-left: 1.25rem; }
.writing__link:hover .writing__title { color: var(--accent); }

.writing__title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  transition: color 0.3s;
}
.writing__item--soon .writing__title { color: var(--muted); }
.writing__date {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- contact / footer ---------- */
.contact { border-top: 1px solid var(--hairline); }

.contact__email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 7.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  transition: color 0.35s;
}
.contact__email:hover { color: var(--accent); }

.contact__links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.contact__links a {
  color: var(--muted);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
}
.contact__links a:hover { color: var(--ink); border-color: var(--accent); }

.contact__foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(3rem, 8vh, 5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- article pages (writing/) ---------- */
.article {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(6rem, 16vh, 10rem) var(--space) clamp(4rem, 10vh, 6rem);
}
.article__back {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3rem;
  transition: color 0.3s;
}
.article__back:hover { color: var(--accent); }
.article h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.article__meta {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3rem;
}
.article p { margin-bottom: 1.4rem; font-size: 1.05rem; line-height: 1.75; }
.article p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  padding-right: 0.12em;
}
.article h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  margin: 2.5rem 0 1rem;
}
.article blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  margin: 2rem 0;
  color: var(--muted);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
}

/* ---------- reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
[data-reveal].is-in { opacity: 1; transform: translateY(0); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .dot { animation: none; }
  .line__inner { animation: none; transform: none; }
  .card__corner, .card__status { animation: none; opacity: 1; }
  .scroll-cue span:not(.scroll-cue__gap) { animation: none; opacity: 1; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .cursor { display: none; }
}
