/* ==========================================================================
   Nick Jolly - Minimalist Retro-Modern Stylesheet
   Version: 3.8.0
   Dynamic Real-Time Typewriter | Frosted Glass Panels | Micro-Hairline Buttons
   ========================================================================== */

/* --- 1. Design Tokens & Variables --- */
:root {
  --font-logo: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-ui: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Consolas", "Monaco", monospace;

  /* Palette: Sleek Dark Slate + High Contrast + Warm Vintage Amber Accent */
  --color-bg-base: #14161a;
  --color-panel-bg: rgba(16, 19, 25, 0.35);
  --color-glass-blur: 10px;
  --color-input-bg: rgba(12, 14, 18, 0.5);
  --overlay-gradient: linear-gradient(180deg, rgba(14, 16, 21, 0.68) 0%, rgba(10, 11, 15, 0.84) 100%);

  --color-text-main: #f0f2f5;
  --color-text-muted: #c8cbd2;
  --color-text-dim: #8a8f9d;

  --color-accent: #298dc5;
  --color-accent-hover: #48a6dd;
  --color-accent-dim: rgba(41, 141, 197, 0.16);
  --titlebar-bg: linear-gradient(90deg, rgba(28, 107, 164, 0.6) 0%, rgba(18, 68, 107, 0.3) 100%);

  /* Warm Terminal Gold for Identity Accents */
  --color-gold: #e9cf76;
  --color-gold-hover: #fae08c;

  /* Subtle Crisp Border Tokens */
  --border-light: rgba(255, 255, 255, 0.24);
  --border-glass: rgba(255, 255, 255, 0.16);
  --border-subtle: rgba(255, 255, 255, 0.1);

  --max-width: 1020px;
  --nav-height: 60px;
}

/* --- Daytime Ambient Theme (Sun is up / Light Mode) --- */
html.theme-day,
html.force-theme-day {
  --color-bg-base: #14161a;
  --color-panel-bg: rgba(16, 19, 25, 0.45);
  --color-glass-blur: 10px;
  --overlay-gradient: linear-gradient(180deg, rgba(14, 16, 21, 0.28) 0%, rgba(10, 11, 15, 0.48) 100%);
  --border-glass: rgba(255, 255, 255, 0.18);
}

/* --- Nighttime Ambient Theme (After sunset / Dark Mode) --- */
html.theme-night,
html.force-theme-night {
  --color-bg-base: #14161a;
  --color-panel-bg: rgba(16, 19, 25, 0.35);
  --color-glass-blur: 10px;
  --overlay-gradient: linear-gradient(180deg, rgba(14, 16, 21, 0.68) 0%, rgba(10, 11, 15, 0.84) 100%);
  --border-glass: rgba(255, 255, 255, 0.16);
}

/* --- 2. Global Reset & Box Sizing --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--color-bg-base);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1.5rem);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text-main);
  background-color: transparent;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  position: relative;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Accessible Focus States */
a:focus-visible,
button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Background Atmosphere */
.page-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-image: url("bg-home.jpg");
  background-size: cover;
  background-position: center 65%;
  background-repeat: no-repeat;
  pointer-events: none;
  transform: translateZ(0);
}

.bg-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--overlay-gradient);
  pointer-events: none;
  transform: translateZ(0);
  transition: background 0.8s ease;
}

/* --- 3. Header & Framed Brand Logo --- */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--color-panel-bg);
  backdrop-filter: blur(var(--color-glass-blur));
  -webkit-backdrop-filter: blur(var(--color-glass-blur));
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ┌ NICK JOLLY ┘ Framing Brand Component */
.site-logo {
  display: inline-flex;
  align-items: center;
}

.brand-frame {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 5px 12px;
  text-decoration: none;
  color: #ffffff;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.brand-frame:hover {
  text-decoration: none;
  opacity: 0.92;
  transform: translateY(-1px);
}

.brand-bracket-tl {
  position: absolute;
  top: -3px;
  left: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(233, 207, 118, 0.35);
  user-select: none;
  font-weight: 300;
}

.brand-text {
  font-family: var(--font-logo);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  padding: 0 4px;
}

.brand-bracket-br {
  position: absolute;
  bottom: -3px;
  right: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1;
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(233, 207, 118, 0.35);
  user-select: none;
  font-weight: 300;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: block;
}

.nav-link:hover {
  color: #ffffff;
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.nav-link.active {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-dim);
}

/* --- 4. Main Layout & Section Containers --- */
.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.content-section {
  padding: 2.75rem 0;
  position: relative;
}

#contact {
  padding-bottom: 5rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #ffffff;
  margin-bottom: 2rem;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1.5rem;
  width: 100%;
}

@keyframes targetGlow {

  0%,
  25% {
    color: var(--color-gold);
    text-shadow: 0 0 12px rgba(233, 207, 118, 0.45);
  }

  100% {
    color: #ffffff;
    text-shadow: none;
  }
}

.content-section:target .section-title {
  animation: targetGlow 1.8s ease-out forwards;
}

.section-title::before,
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-subtle);
}

/* --- 5. Hero Section (Dynamic Typing Stage) --- */
.hero-section {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 0 0 0;
  text-align: center;
}

.hero-centered-layout {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.headline-stage {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  width: 100%;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.0vw, 2.05rem);
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #ffffff;
  line-height: 1.3;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 0.35em;
  text-align: center;
}

.hero-prefix {
  white-space: nowrap;
}

.hero-amp {
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(233, 207, 118, 0.35);
  font-weight: 500;
}

.hero-dynamic-wrap {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  min-height: 1.3em;
}

#heroDynamicWord {
  color: #ffffff;
  font-weight: 500;
}

/* Authentic Retro Terminal Block Cursor (DOS/VT100 style) */
.cursor-underscore {
  font-family: var(--font-mono);
  color: transparent;
  position: relative;
  width: 0.3em;
  margin-left: 2px;
  font-weight: 400;
  display: inline-block;
  user-select: none;
  animation: cursor-blink 0.85s infinite steps(1);
}

.cursor-underscore::after {
  content: '';
  position: absolute;
  inset: 0.12em 0;
  background-color: var(--color-gold);
}

@keyframes cursor-blink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

/* Hero buttons hidden on desktop (navigation provided by top header) */
.hero-btn-row {
  display: none;
}

/* --- 6. Tactile Monospace Button Styling - Rich Glass Presence --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 9px 20px;
  min-width: 180px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  border: 1px solid rgba(41, 141, 197, 0.55);
  background: rgba(28, 107, 164, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.25);
  color: #ffffff !important;
  transition: all 0.2s ease;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  line-height: normal;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  border-color: var(--color-accent-hover);
  background: rgba(41, 141, 197, 0.45);
  color: #ffffff !important;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 16px rgba(41, 141, 197, 0.35);
}

.btn:active {
  transform: scale(0.985);
  background: rgba(41, 141, 197, 0.55);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* --- 7. Modernized Windows 95 Beveled Panel --- */
.beveled-panel {
  background: var(--color-panel-bg);
  backdrop-filter: blur(var(--color-glass-blur));
  -webkit-backdrop-filter: blur(var(--color-glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.16),
    inset -1px -1px 0 rgba(0, 0, 0, 0.45),
    0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 2.25rem;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.panel-header-bar {
  background: var(--titlebar-bg);
  padding: 9px 16px;
  margin: -2.25rem -2.25rem 1.5rem -2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.panel-tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}

/* About / Summary Section Styling */
.summary-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--color-text-main);
  max-width: 840px;
  margin: 0 auto;
}

.summary-body p {
  margin-bottom: 1.35rem;
}

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

.summary-body strong {
  color: #ffffff;
  font-weight: 600;
}

.summary-actions {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.75rem;
  flex-wrap: wrap;
}

/* --- 8. Software Portfolio Grid (Option 1 Glass Cards) --- */
.software-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.software-card {
  background: var(--color-panel-bg);
  backdrop-filter: blur(var(--color-glass-blur));
  -webkit-backdrop-filter: blur(var(--color-glass-blur));
  border: 1px solid var(--border-glass);
  padding: 1.75rem;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.software-card:hover {
  background: rgba(22, 26, 34, 0.6);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.software-card-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(28, 107, 164, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 0.85rem;
  width: fit-content;
}

.software-card-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.85rem;
  line-height: 1.35;
}

.software-card-desc {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.software-card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.software-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.software-badge:hover {
  color: #ffffff;
  text-shadow: 0 0 8px rgba(72, 166, 221, 0.7);
  text-decoration: none;
}

.software-badge-static {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text-dim);
}

/* --- 9. Inquiries & Contact Form --- */
.contact-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.form-name-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--color-input-bg);
  border: 1px solid var(--border-glass);
  border-radius: 2px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.form-input:focus,
.form-input:focus-visible {
  background-color: rgba(16, 19, 26, 0.85);
  border-color: var(--color-accent);
  outline: none;
}

/* Real-Time Form Validation Error Glow & Pulse */
.form-input.input-error {
  border-color: #ff5c5c !important;
  background-color: rgba(255, 92, 92, 0.07) !important;
  box-shadow: 0 0 10px rgba(255, 92, 92, 0.35);
  animation: field-error-pulse 0.75s ease-in-out;
}

@keyframes field-error-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 92, 92, 0.7);
    border-color: #ff5c5c;
  }

  50% {
    box-shadow: 0 0 14px 2px rgba(255, 92, 92, 0.55);
    border-color: #ff7b72;
  }

  100% {
    box-shadow: 0 0 8px rgba(255, 92, 92, 0.3);
    border-color: #ff5c5c;
  }
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
  font-family: var(--font-body);
}

/* Honeypot Spam Field (Invisible to humans) */
.form-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.form-actions-row {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.form-feedback {
  padding: 0.75rem 1.25rem;
  border-radius: 2px;
  font-family: var(--font-ui);
  font-size: 13px;
  display: none;
  width: 100%;
  margin-top: 1rem;
}

.form-feedback.success {
  display: block;
  background: rgba(46, 160, 67, 0.15);
  border: 1px solid rgba(46, 160, 67, 0.5);
  color: #7ee787;
}

.form-feedback.error {
  display: block;
  background: rgba(248, 81, 73, 0.15);
  border: 1px solid rgba(248, 81, 73, 0.5);
  color: #ff7b72;
}

/* --- 10. Footer --- */
.site-footer {
  width: 100%;
  background: var(--color-panel-bg);
  backdrop-filter: blur(var(--color-glass-blur));
  -webkit-backdrop-filter: blur(var(--color-glass-blur));
  border-top: 1px solid var(--border-subtle);
  padding: 1.15rem 0;
  font-size: 13px;
  color: var(--color-text-dim);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-status-pill p {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--color-text-dim);
  font-size: 12px;
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* --- 11. Responsive Media Queries --- */
@media screen and (max-width: 820px) {
  .desktop-nav {
    display: none !important;
  }

  .header-inner {
    justify-content: center;
    padding: 0.75rem 1.5rem;
  }

  .hero-section {
    min-height: calc(54vh - var(--nav-height));
    padding: 3.5rem 0 2rem 0;
  }

  .headline-stage {
    margin-bottom: 2rem;
  }

  .hero-btn-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    width: 100%;
  }

  .hero-btn-row .btn {
    padding: 13px 22px;
  }

  .content-section {
    padding: 2.75rem 0;
  }

  #about {
    padding-top: 2rem;
  }

  #contact {
    padding-bottom: 5rem;
  }

  .btn {
    width: 100%;
    max-width: 260px;
  }

  /* Software Grid Stacking */
  .software-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Form Stacking */
  .contact-form-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Input zoom prevention on mobile Safari */
  .form-input {
    font-size: 16px;
  }

  .form-actions-row {
    flex-direction: column;
    align-items: center;
  }

  .summary-actions {
    flex-direction: column;
    align-items: center;
  }

  .beveled-panel {
    padding: 1.5rem 1.25rem;
  }

  .panel-header-bar {
    margin: -1.5rem -1.25rem 1.25rem -1.25rem;
    padding: 8px 14px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 1rem;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Specific Mobile Jitter Prevention for Typewriter Headline */
@media screen and (max-width: 640px) {
  .headline-stage {
    min-height: 64px;
    margin-bottom: 1.75rem;
  }

  .hero-tagline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.55rem, 6.0vw, 1.95rem);
    line-height: 1.35;
    row-gap: 0.15rem;
  }

  .hero-prefix {
    display: block;
    white-space: nowrap;
  }

  .hero-dynamic-wrap {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    min-height: 1.35em;
    white-space: nowrap;
  }
}

@media screen and (max-width: 480px) {
  .form-name-split {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .container {
    padding: 0 1.15rem;
  }
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .cursor-underscore {
    animation: none;
    opacity: 1;
  }
}