/* ==========================================================================
   gianmaria.dev - homepage stylesheet
   Ready for:
   - external CSS separation
   - dark mode via prefers-color-scheme
   - manual override via body[data-theme="light|dark"]
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   Theme tokens
   Default: light
   Manual override supported via:
   - body[data-theme="light"]
   - body[data-theme="dark"]
   Auto dark supported when no explicit data-theme is set
   -------------------------------------------------------------------------- */
:root {
  --bg: #fafafa;
  --ink: #111111;
  --red: #9b1c1c;
  --muted: #666666;
  --border: #e0e0e0;
  --border-strong: #c8c8c8;
  --card: #ffffff;

  --hero-terminal-bg: rgba(255, 255, 255, 0.72);
  --hero-terminal-border: rgba(17, 17, 17, 0.08);
  --hero-terminal-text: var(--red);
  --hero-terminal-prompt: var(--ink);

  --shadow-soft: 0 0 0 0 rgba(0, 0, 0, 0);
}

body[data-theme="light"] {
  --bg: #fafafa;
  --ink: #111111;
  --red: #9b1c1c;
  --muted: #666666;
  --border: #e0e0e0;
  --border-strong: #c8c8c8;
  --card: #ffffff;

  --hero-terminal-bg: rgba(255, 255, 255, 0.72);
  --hero-terminal-border: rgba(17, 17, 17, 0.08);
  --hero-terminal-text: var(--red);
  --hero-terminal-prompt: var(--ink);

  --shadow-soft: 0 0 0 0 rgba(0, 0, 0, 0);
}

body[data-theme="dark"] {
  --bg: #0f0f10;
  --ink: #f3f3f3;
  --red: #b52a2a;
  --muted: #a1a1a1;
  --border: #2b2b2d;
  --border-strong: #3a3a3d;
  --card: #171718;

  --hero-terminal-bg: rgba(255, 255, 255, 0.04);
  --hero-terminal-border: rgba(255, 255, 255, 0.10);
  --hero-terminal-text: #ffb0a8;
  --hero-terminal-prompt: #f3f3f3;

  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.18);
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --bg: #0f0f10;
    --ink: #f3f3f3;
    --red: #b52a2a;
    --muted: #a1a1a1;
    --border: #2b2b2d;
    --border-strong: #3a3a3d;
    --card: #171718;

    --hero-terminal-bg: rgba(255, 255, 255, 0.04);
    --hero-terminal-border: rgba(255, 255, 255, 0.10);
    --hero-terminal-text: #ffb0a8;
    --hero-terminal-prompt: #f3f3f3;

    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.18);
  }
}

/* --------------------------------------------------------------------------
   Global
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* --------------------------------------------------------------------------
   Top nav
   -------------------------------------------------------------------------- */
nav {
  padding: 32px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.logo {
  font-family: 'Google Sans Code', monospace;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.nav-mail {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.2s, border-color 0.2s;
}

.nav-mail:hover {
  color: var(--red);
  border-color: var(--red);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--red);
  background: var(--card);
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s,
    background-color 0.2s,
    transform 0.18s;
}

.theme-toggle:hover {
  color: var(--red);
  border-color: var(--red);
}

.theme-toggle:active {
  transform: scale(0.99);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  padding: 88px 0 52px;
  border-bottom: 0.5px solid var(--border);
}

.eyebrow {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.bigname {
  font-family: 'Google Sans Code', monospace;
  font-weight: 600;
  font-size: clamp(40px, 9vw, 96px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 14px;
}

.terminal-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  margin: 0 0 18px;
  user-select: none;
}

.terminal-mark .cursor {
  color: var(--red);
  animation: blinkCursor 1s steps(1) infinite;
}

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

.redline {
  display: block;
  width: 50px;
  height: 5px;
  background: var(--red);
  margin: 0 0 22px;
}

.tagline {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.75;
}

.hero-terminal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid var(--hero-terminal-border);
  border-radius: 12px;
  background: var(--hero-terminal-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: 'Inter', 'IBM Plex Mono', monospace;
  font-size: 14px;
  line-height: 1;
  color: var(--hero-terminal-text);
  letter-spacing: 0.02em;
}

.hero-terminal__prompt {
  color: var(--hero-terminal-prompt);
  font-weight: 700;
}

.hero-terminal__text {
  color: var(--hero-terminal-text);
  white-space: nowrap;
}

.hero-terminal__cursor {
  display: inline-block;
  color: var(--hero-terminal-prompt);
  animation: terminalBlink 0.9s steps(1, end) infinite;
}

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

/* --------------------------------------------------------------------------
   Link grid
   -------------------------------------------------------------------------- */
.links {
  padding: 28px 0 44px;
}

.linklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.banner {
  min-height: 220px;
  display: flex;
  -webkit-tap-highlight-color: transparent;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  border: 0.9px solid var(--border);
  background: var(--card);
  position: relative;
  transition:
    border-color 0.2s,
    transform 0.18s,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
  box-shadow: var(--shadow-soft);
}

.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 3px;
  background: var(--red);
}

.banner:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.banner:active {
  transform: scale(0.995);
}

.banner:hover .banner-title,
.banner:hover .banner-arrow,
.banner:hover .banner-index {
  color: var(--red);
}

.banner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.banner-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.banner-index {
  font-family: 'Google Sans Code', monospace;
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.2s;
}

.banner-terminal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 6px 8px;
  border: 1px solid var(--hero-terminal-border);
  border-radius: 7px;
  background: var(--hero-terminal-bg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.03em;
  color: var(--hero-terminal-text);
}

.banner-terminal__prompt,
.banner-terminal__cursor {
  color: var(--hero-terminal-prompt);
}

.banner-terminal__text {
  color: var(--hero-terminal-text);
  white-space: nowrap;
}

.banner-terminal__cursor {
  display: inline-block;
  animation: terminalBlink 0.9s steps(1, end) infinite;
}

.banner-arrow {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--muted);
  transition: color 0.2s, transform 0.2s;
}

.banner:hover .banner-arrow {
  transform: translate(2px, -2px);
}

.banner-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.banner-title {
  display: block;
  font-family: 'Google Sans Code', monospace;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  transition: color 0.2s;
}

.banner-desc {
  font-family: 'Inter', system-ui, sans-serif;
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 24ch;
}

/* --------------------------------------------------------------------------
   Contact strip
   -------------------------------------------------------------------------- */
.contact-strip {
  position: relative;
  margin: 0 0 28px;
  padding: 32px 22px 30px;
  border: 0.9px solid var(--border);
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.contact-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--red);
}

.contact-strip__kicker {
  margin-bottom: 24px;
  font-family: 'Google Sans Code', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.contact-strip__text {
  margin-bottom: 14px;
  font-size: 16px;
  color: var(--ink);
}

.contact-strip__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 34px;
  border: 1px solid var(--red);
  color: var(--ink);
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.contact-strip__link:hover,
.contact-strip__link:focus-visible {
  color: #ffffff;
  background: var(--red);
  border-color: var(--red);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  padding: 22px 0 40px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.fcopy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}

.fcopy a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.fcopy a:hover,
.fcopy a:focus-visible {
  color: var(--red);
}

.footer-note {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-transform: uppercase;
}

.footer-note__online {
  color: #14D928;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero {
    padding: 64px 0 44px;
  }

  .links {
    padding: 16px 0 36px;
  }

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

  .banner {
    min-height: 170px;
    padding: 20px;
  }

  .banner-title {
    font-size: 18px;
    line-height: 1.28;
  }

  .banner-desc {
    max-width: 90%;
  }
}

@media (max-width: 640px) {
  .hero-terminal {
    font-size: 13px;
    padding: 9px 12px;
    min-height: 30px;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 0 20px;
  }

  nav {
    padding: 20px 0 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .logo,
  .theme-toggle {
    font-size: 15px;
  }

  .hero {
    padding: 52px 0 36px;
  }

  .eyebrow {
    font-size: 12px;
    margin-bottom: 16px;
  }

  .bigname {
    font-size: clamp(38px, 11vw, 56px);
    line-height: 1;
    margin-bottom: 14px;
  }

  .terminal-mark {
    font-size: 24px;
    margin: 0 0 16px;
  }

  .redline {
    margin: 0 0 18px;
  }

  .tagline {
    font-size: 16px;
    line-height: 1.65;
    max-width: 100%;
  }

  .hero-terminal {
    font-size: 14px;
  }

  .links {
    padding: 12px 0 32px;
  }

  .banner {
    min-height: 156px;
    padding: 18px;
  }

  .banner--case-study {
    min-height: 178px;
  }

  .banner--case-study .banner-terminal {
    margin-bottom: 12px;
  }

  .banner-top {
    gap: 12px;
  }

  .banner-index {
    font-size: 13px;
  }

  .banner-arrow {
    font-size: 18px;
  }

  .banner-title {
    font-size: 22px;
    line-height: 1.28;
  }

  .banner-desc {
    font-size: 16px;
    max-width: 100%;
  }

  .banner-terminal {
    font-size: 12px;
  }

  .contact-strip {
    margin-bottom: 24px;
    padding: 28px 18px 26px;
  }

  .contact-strip__kicker {
    margin-bottom: 18px;
    font-size: 12px;
  }

  .contact-strip__text {
    font-size: 15px;
    line-height: 1.55;
  }

  .contact-strip__link {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: var(--red);
    border-color: var(--red);
  }

}

.banner--sprite {
  cursor: pointer;
  justify-content: space-between;
  align-items: stretch;
  overflow: hidden;
}

.banner--sprite:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}

.banner--sprite:hover .banner-title,
.banner--sprite:hover .banner-index,
.banner--sprite:hover .banner-arrow {
  color: var(--red);
}

.banner-sprite-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  min-height: 0;
}

.banner-sprite {
  width: auto;
  max-height: 110px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  user-select: none;
  pointer-events: none;
}

@media (max-width: 768px) {
  .banner-sprite {
    max-height: 104px;
  }
}

@media (max-width: 480px) {
  .banner--sprite {
    min-height: 190px;
  }
  .banner-sprite {
    max-height: 108px;
  }
}
