/* ═══════════════════════════════════════════════════════════
   JOSH TYRANGIEL — Typewriter Brutal
   One font, two sizes, massive whitespace
   ═══════════════════════════════════════════════════════════ */


/* ── Design Tokens ──────────────────────────────────────── */

:root {
  --black: #1a1a1a;
  --white: #ffffff;
  --gray: #999;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --text-s: 14px;
  --text-l: 20px;
  --side-padding: 60px;
  --section-gap: 200px;
  --blue: #0000ff;
  --duration: 0.2s;
}


/* ── Reset & Base ───────────────────────────────────────── */

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

html {
  font-size: 16px;
  scroll-behavior: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--text-s);
  line-height: 2.1;
  color: var(--black);
  background-color: var(--white);
  overflow-x: hidden;
}


img {
  display: block;
  max-width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.6s ease;
}

img.is-loaded {
  opacity: 1;
}

ul {
  list-style: none;
}

::selection {
  background: var(--black);
  color: var(--white);
}


/* ── Typography ─────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--text-l);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
}


/* ── Links ──────────────────────────────────────────────── */

a {
  color: inherit;
  text-decoration: none;
  text-decoration-color: var(--blue);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: var(--blue);
}


/* ── Section Layout ─────────────────────────────────────── */

.section {
  position: relative;
  padding: var(--section-gap) var(--side-padding);
  border: none;
}

.section__inner {
  max-width: 680px;
}

.section__heading {
  font-size: var(--text-l);
  font-weight: 400;
  margin-bottom: 40px;
  letter-spacing: -0.01em;
}

.typewriter-cursor::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: #0066ff;
  margin-left: 2px;
  vertical-align: text-bottom;
  position: relative;
  top: -4px;
  animation: blink 0.6s step-end infinite;
}

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

.section__inner p {
  margin-bottom: 24px;
}

.section__inner p:last-child {
  margin-bottom: 0;
}


/* ── Navigation ─────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 50%;
  z-index: 100;
  padding: 20px var(--side-padding);
  color: var(--white);
  mix-blend-mode: difference;
}

.site-header__name {
  font-family: var(--font);
  font-size: var(--text-l);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.site-header__name.typewriter-cursor::after {
  background: #ff9900;
  top: -2px;
}

.nav {
  display: flex;
  align-items: center;
}

.nav__menu {
  display: flex;
  gap: 24px;
}

.nav__link {
  font-family: var(--font);
  font-size: var(--text-s);
  font-weight: 400;
  position: relative;
}

.nav__link:hover {
  text-decoration: underline;
  text-decoration-color: #ffff00;
}

.nav__link--active {
  text-decoration: underline;
  text-decoration-color: #ffff00;
}


.nav__select {
  display: none;
}

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle-bar {
  display: block;
  width: 100%;
  height: 1px;
  background: currentColor;
  transition: transform 0.15s ease, opacity 0.15s ease;
  transform-origin: center;
}

.nav__toggle--open .nav__toggle-bar:first-child {
  transform: rotate(45deg) translate(2.5px, 2.5px);
}

.nav__toggle--open .nav__toggle-bar:last-child {
  transform: rotate(-45deg) translate(2.5px, -2.5px);
}


/* ── Mobile Nav Overlay ─────────────────────────────────── */

.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay--open {
  opacity: 1;
  visibility: visible;
}

.nav-overlay__menu {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nav-overlay__link {
  font-family: var(--font);
  font-size: var(--text-l);
  font-weight: 400;
}

.nav-overlay__link:hover {
  text-decoration: underline;
  text-decoration-color: var(--blue);
}


/* ── Hero ────────────────────────────────────────────────── */

.section--hero {
  padding: 0;
  min-height: 100vh;
}

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.hero__text {
  display: flex;
  align-items: flex-end;
  padding: 60px;
  padding-bottom: 6rem;
}

.hero__intro {
  font-size: var(--text-s);
  line-height: 2.1;
  margin-bottom: 24px;
}

.hero__intro strong {
  font-weight: 700;
}

.hero__intro em {
  font-style: italic;
}

.hero__intro a {
  text-decoration: underline;
  text-decoration-color: var(--blue);
}

.hero__photo {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.hero__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ── Book Section ────────────────────────────────────────── */

.section[aria-label="About the book"] .section__inner {
  max-width: none;
}

.book-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.book-layout__cover {
  position: relative;
  overflow: hidden;
}

.book-cover__img {
  width: 100%;
  height: auto;
}

.book-layout__text {
  max-width: 680px;
}

blockquote {
  font-style: italic;
  padding-left: 40px;
  margin: 40px 0;
  color: var(--gray);
}

.book-praise {
  margin: 40px 0;
}

.book-praise p {
  margin-bottom: 24px;
}

.cite {
  font-style: normal;
  color: var(--gray);
}

.book-buy {
  margin: 40px 0;
}

.book-buy a {
  text-decoration: underline;
  text-decoration-color: var(--blue);
}

.book-events {
  margin: 40px 0;
}

.book-media {
  margin: 40px 0;
}

.book-media a {
  text-decoration: underline;
  text-decoration-color: var(--blue);
}

.cv {
  margin-top: 40px;
  padding-left: 40px;
}


/* ── Article / Media Lists ───────────────────────────────── */

.article-list p,
.media-list p {
  margin-bottom: 24px;
}

.article-list p a {
  font-weight: 700;
}


/* ── Bio Layout ──────────────────────────────────────────── */

.bio-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
}



/* ── Speaking Photo ──────────────────────────────────────── */

.speaking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.speaking-grid__text p {
  margin-bottom: 24px;
}

.speaking-grid__text p:last-child {
  margin-bottom: 0;
}

.speaking-grid__photo {
  max-width: 300px;
}

.speaking-photo__img {
  width: 100%;
  height: auto;
}


/* ── Backstory — Dark Section ────────────────────────────── */

.section--dark {
  background: #000000;
  color: var(--white);
}

.backstory-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.backstory-logo {
  max-width: 140px;
  height: auto;
  margin-top: 48px;
}

.section--dark a:hover {
  color: var(--gray);
  text-decoration: underline;
  text-decoration-color: var(--blue);
}

#backstory a:hover,
.backstory-link:hover {
  color: inherit;
  text-decoration: none;
}


/* ── Contact Form ────────────────────────────────────────── */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 40px;
}

.form-field label {
  display: block;
  color: var(--gray);
  margin-bottom: 4px;
  font-size: var(--text-s);
  font-family: var(--font);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: var(--font);
  font-size: var(--text-s);
  color: var(--black);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray);
  padding: 8px 0;
  outline: none;
  border-radius: 0;
  -webkit-appearance: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-bottom-color: var(--black);
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.form-field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 24px;
}

.form-submit {
  font-family: var(--font);
  font-size: var(--text-s);
  background: none;
  border: none;
  color: var(--black);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--blue);
  text-underline-offset: 2px;
  text-align: left;
}

.form-submit:hover {
  color: var(--gray);
}

.form-confirmation {
  overflow: hidden;
}

.form-confirmation__inner {
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  font-family: var(--font);
  font-size: var(--text-s);
  color: var(--black);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.form-confirmation__inner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.form-confirmation__check {
  display: block;
  margin: 0 auto 16px;
  width: 48px;
  height: 48px;
  opacity: 0;
  transition: opacity 0.3s ease 0.3s;
}

.form-confirmation__inner.is-visible .form-confirmation__check {
  opacity: 1;
}

.contact-links {
  margin-top: 40px;
}


/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
  padding: 40px var(--side-padding);
}

.site-footer__copy {
  font-family: var(--font);
  font-size: var(--text-s);
  color: var(--gray);
}


/* ── Animation: Initial States ───────────────────────────── */

.anim-reveal {
  opacity: 0;
}

.anim-fade {
  opacity: 0;
}

.hero__intro {
  opacity: 0;
}


/* ── Responsive: Tablet ──────────────────────────────────── */

@media (max-width: 1200px) {
  .site-header {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    mix-blend-mode: difference;
    color: var(--white);
  }

  .site-header__name {
    margin-bottom: 0;
  }

  .nav__menu {
    display: none;
  }

  .nav__toggle {
    display: none;
  }

  .nav__select {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: none;
    color: inherit;
    font-family: var(--font);
    font-size: var(--text-s);
    font-weight: 400;
    cursor: pointer;
    padding: 0;
    text-align: right;
  }

  .nav__select--visible {
    opacity: 1;
    pointer-events: auto;
  }

  .nav__select:focus {
    outline: none;
  }
}


/* ── Responsive: Mobile ──────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --side-padding: 24px;
    --section-gap: 120px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero__text {
    padding: 80px 24px 40px;
  }

  .hero__photo {
    height: 60vh;
  }

  .book-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .bio-layout {
    grid-template-columns: 1fr;
  }


  .speaking-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}


/* ── Reduced Motion ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .anim-reveal,
  .anim-fade,
  .hero__photo {
    opacity: 1;
    transform: none;
  }
}
