/* The iOS Interview Handbook — site styles */

:root {
  --bg: #0d1117;
  --bg-elevated: #161b22;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --accent: #0a84ff;
  --accent-hover: #0066cc;
  --border: #e8e8e8;
  --radius: 12px;
  --font-sans: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  background: var(--bg);
  color: #f0f0f0;
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #30363d;
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
}

.site-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  align-items: center;
}

.site-nav a {
  color: #c9d1d9;
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: #fff;
}

.site-nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid #484f58;
  color: #fff;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .site-nav__toggle {
    display: block;
  }

  .site-nav {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }
}

/* Hero */
.hero {
  background: linear-gradient(165deg, #0d1117 0%, #1c2333 50%, #0d1117 100%);
  color: #e6edf3;
  padding: 3.5rem 1.25rem 4rem;
  text-align: center;
}

.hero__inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero--with-cover {
  padding-top: 2.5rem;
}

.hero--with-cover .hero__grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  align-items: center;
  justify-items: center;
}

.hero--with-cover .hero__content {
  max-width: 640px;
}

.hero__cover {
  margin: 0;
  max-width: 280px;
  width: 100%;
}

.hero__cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.25),
    0 24px 48px rgba(0, 0, 0, 0.35);
}

@media (min-width: 768px) {
  .hero--with-cover {
    text-align: left;
    padding-top: 3.5rem;
  }

  .hero--with-cover .hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
    justify-items: start;
    gap: 2.5rem 3rem;
  }

  .hero--with-cover .hero__cover {
    justify-self: end;
    max-width: 260px;
  }

  .hero--with-cover .hero__cta {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .hero--with-cover .hero__cover {
    order: -1;
  }

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

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero__lead {
  font-size: 1.15rem;
  color: #8b949e;
  margin: 0 0 2rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: #c9d1d9;
  border: 1px solid #484f58;
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* Ghost on light surfaces (cards) */
.btn--ghost-light {
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost-light:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.thanks-cta {
  margin-top: 1.25rem;
}

/* Sections */
.section {
  padding: 3rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section--alt {
  background: #f6f8fa;
}

.section h2 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.section__intro {
  color: var(--text-muted);
  margin: 0 0 2rem;
  max-width: 60ch;
}

/* Book section header with cover thumbnail */
.book-head {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .book-head {
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
  }
}

.book-head__cover {
  margin: 0;
  max-width: 140px;
}

.book-head__cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.book-head__text h2 {
  margin-top: 0;
}

.book-head__intro {
  margin-bottom: 0;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: #d0d7de;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card a.more {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Book strip */
.book-strip {
  background: var(--bg-elevated);
  color: #e6edf3;
  padding: 2.5rem 1.25rem;
  border-top: 1px solid #30363d;
  border-bottom: 1px solid #30363d;
}

.book-strip__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 768px) {
  .book-strip__inner {
    grid-template-columns: 1fr auto;
  }
}

.book-strip h2 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.book-strip p {
  margin: 0;
  color: #8b949e;
  max-width: 52ch;
}

/* Article / list pages */
.page-header {
  padding: 2.5rem 1.25rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.page-header .lede {
  color: var(--text-muted);
  margin: 0;
  max-width: 60ch;
}

.content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.tip-list,
.topic-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tip-list li,
.topic-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.tip-list li:last-child,
.topic-list li:last-child {
  border-bottom: none;
}

.tip-list h2,
.topic-list h2 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.tip-list p,
.topic-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

/* Footer */
.site-footer {
  background: var(--bg);
  color: #8b949e;
  padding: 2rem 1.25rem;
  font-size: 0.9rem;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-footer a {
  color: #c9d1d9;
}

/* Contact form */
.contact-layout {
  max-width: 560px;
}

.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label,
.form-label-text {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.form-hint {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-hint--recaptcha {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.form-input:focus {
  outline: 2px solid rgba(10, 132, 255, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
}

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

.form-group--captcha {
  margin-top: 1.5rem;
}

/* reCAPTCHA v2 iframe (~78px) */
.form-group--captcha .g-recaptcha,
#recaptcha-widget.g-recaptcha {
  min-height: 78px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.form-error {
  color: #b42318;
  font-size: 0.9rem;
}

.form-error--box {
  padding: 0.85rem 1rem;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.form-error code {
  font-size: 0.85em;
}

.form-actions {
  margin-top: 1.5rem;
}

.btn--form {
  cursor: pointer;
  font: inherit;
}

.btn--form:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
