/* grad-work/example-site/public/css/style.css — Klasker AITA */

/* --------------------------------------------------
Variables
-------------------------------------------------- */

:root {
  --background: #120705;
  --surface: #1d0b08;
  --surface-hover: #31100c;

  --primary: #f26b1d;
  --secondary: #c74812;

  --text: #f3e9df;
  --muted: #d0b6a4;
  --footer-text: #b79f90;

  --border: rgba(255, 255, 255, 0.08);
  --overlay: rgba(0, 0, 0, 0.35);
}


/* --------------------------------------------------
Base
-------------------------------------------------- */

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

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;

  font-family:
    Inter,
    "Noto Sans",
    system-ui,
    sans-serif;

  background:
    radial-gradient(
      circle at top,
      #31100c 0%,
      var(--background) 65%
    );

  color: var(--text);
  line-height: 1.6;
}


/* --------------------------------------------------
Links
-------------------------------------------------- */

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}


/* --------------------------------------------------
Container
-------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1000px;

  margin: 0 auto;
  padding: 1rem;
}


/* --------------------------------------------------
Header
-------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 2rem;

  text-align: center;
}


/* --------------------------------------------------
Site Brand
-------------------------------------------------- */

.site-brand {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  text-decoration: none;
}

.site-brand .logo-img {
  display: block;

  width: auto;
  height: 70px;
}


/* --------------------------------------------------
Main Navigation
-------------------------------------------------- */

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 1.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--primary);
}


/* --------------------------------------------------
Search
-------------------------------------------------- */

.search {
  margin-left: auto;
}


/* --------------------------------------------------
Banner
-------------------------------------------------- */

.banner {
  width: 100%;

  overflow: hidden;

  border-bottom: 1px solid var(--border);

  background: var(--background);

  text-align: center;
}

.banner img {
  display: block;

  width: 100%;
  max-width: 1600px;
  height: auto;

  margin: 0 auto;
}


/* --------------------------------------------------
Main Page
-------------------------------------------------- */

main {
  width: 100%;
}

main > .hero,
main > .section {
  width: min(100% - 2rem, 1000px);

  margin-left: auto;
  margin-right: auto;
}


/* --------------------------------------------------
Hero
-------------------------------------------------- */

.hero {
  padding: 3rem 1rem 1rem;

  text-align: center;
}

.hero-logo {
  display: block;

  width: min(100%, 520px);
  height: auto;

  margin: 0 auto 1.5rem;
}

.hero h1 {
  margin: 0;

  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
}

.hero .subtitle {
  margin-top: 0.75rem;

  color: var(--muted);
  font-size: 1.15rem;
}

.hero p {
  max-width: 720px;

  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;

  gap: 0.75rem;
  flex-wrap: wrap;

  margin-top: 1.5rem;
}


/* --------------------------------------------------
Widget Grid
-------------------------------------------------- */

.widget-grid {
  width: 100%;

  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 1rem;

  margin-top: 2rem;
}


/* --------------------------------------------------
Widget Windows
-------------------------------------------------- */

.widget {
  display: flex;
  flex-direction: column;
  align-items: center;

  min-height: 200px;

  padding: 1.5rem;

  border: 1px solid var(--border);
  border-radius: 10px;

  background:
    linear-gradient(
      145deg,
      rgba(49, 16, 12, 0.95),
      rgba(29, 11, 8, 0.95)
    );

  color: var(--text);

  text-align: center;

  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.25);

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.widget:hover {
  background:
    linear-gradient(
      145deg,
      #31100c,
      #1d0b08
    );

  border-color:
    rgba(242, 107, 29, 0.45);

  transform: translateY(-3px);

  box-shadow:
    0 7px 24px rgba(0, 0, 0, 0.35);
}

.widget h3 {
  margin: 0 0 0.75rem;

  font-size: 1.25rem;
}

.widget p {
  max-width: 600px;

  margin: 0 auto 0.75rem;

  color: var(--muted);
}

.widget-note {
  font-size: 0.9rem;
}

.widget .button {
  margin-top: 1rem;
}


/* --------------------------------------------------
Widget Lists
-------------------------------------------------- */

.widget-list {
  width: fit-content;

  margin: 1rem auto 0;
  padding-left: 1.5rem;

  text-align: left;
}

.widget-list li {
  margin-bottom: 0.5rem;

  text-align: left;
}

.widget-list li:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------
Scanner Lists
-------------------------------------------------- */

.scanner-list {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  text-align: left;
}


/* --------------------------------------------------
Premium Widget
-------------------------------------------------- */

.widget.premium {
  border-color:
    rgba(242, 107, 29, 0.35);

  background:
    linear-gradient(
      145deg,
      rgba(61, 21, 12, 0.98),
      rgba(29, 11, 8, 0.98)
    );
}

.widget.premium h3 {
  color: var(--primary);
}


/* --------------------------------------------------
Public Evaluation
-------------------------------------------------- */

.public-evaluation {
  width: 100%;

  margin-top: 2rem;
  padding: 1.5rem;

  border: 1px solid var(--border);
  border-radius: 8px;

  background:
    rgba(29, 11, 8, 0.75);

  text-align: center;
}

.public-evaluation h2 {
  margin-bottom: 0.5rem;
}

.public-evaluation p {
  max-width: 720px;

  margin-left: auto;
  margin-right: auto;

  color: var(--muted);
}


/* --------------------------------------------------
Section
-------------------------------------------------- */

.section {
  margin-top: 3rem;

  text-align: center;
}

.section h2 {
  margin-bottom: 0.75rem;
}

.section p {
  max-width: 760px;

  margin-left: auto;
  margin-right: auto;

  color: var(--muted);
}

.section-heading {
  text-align: center;
}


/* --------------------------------------------------
Buttons
-------------------------------------------------- */

.button {
  display: inline-block;

  margin-top: 1rem;
  padding: 0.65rem 1rem;

  border: 1px solid var(--primary);
  border-radius: 6px;

  background: transparent;

  color: var(--text);

  text-decoration: none;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.button:hover {
  background: var(--primary);

  color: #120705;
}

.button-primary {
  background: var(--primary);

  color: #120705;
}

.button-primary:hover {
  background: var(--secondary);

  color: var(--text);

  border-color: var(--secondary);
}

.button-secondary {
  background: transparent;

  color: var(--text);
}

.button-secondary:hover {
  background: var(--primary);

  color: #120705;
}


/* --------------------------------------------------
Analysis Form
-------------------------------------------------- */

.analysis-form {
  display: flex;
  flex-direction: column;
  align-items: center;

  max-width: 700px;

  margin: 1.5rem auto 0;
}

.analysis-form label {
  margin-bottom: 0.5rem;

  font-weight: 600;
}

.analysis-form input {
  width: 100%;

  padding: 0.75rem 1rem;

  border: 1px solid var(--border);
  border-radius: 6px;

  background: var(--surface);

  color: var(--text);

  font: inherit;
}

.analysis-form input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


/* --------------------------------------------------
Observatory Preview
-------------------------------------------------- */

.observatory-preview {
  width: 100%;

  margin-top: 1.5rem;
  padding: 1.5rem;

  border: 1px solid var(--border);
  border-radius: 8px;

  background: var(--surface);

  text-align: center;
}

.observatory-preview p {
  margin-bottom: 0.5rem;
}


/* --------------------------------------------------
Klasker Navigation
-------------------------------------------------- */

/*
The front page uses widgets for Login and Premium.
They are therefore not duplicated in the header.
*/

.grad-menu-button {
  display: none;

  margin-left: 1rem;
  padding: 0.4rem 0.7rem;

  font-size: 1.5rem;
  line-height: 1;

  cursor: pointer;

  background: transparent;

  border: 1px solid var(--border);
  border-radius: 6px;

  color: var(--text);
}

.grad-navigation {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 1rem;

  transition: transform 0.25s ease;
}

.grad-navigation a,
.grad-navigation a:visited {
  color: var(--muted);
  text-decoration: none;
}

.grad-navigation a:hover,
.grad-navigation a:active {
  color: var(--primary);
  text-decoration: none;
}


/* --------------------------------------------------
Overlay
-------------------------------------------------- */

.grad-overlay {
  display: none;

  position: fixed;
  inset: 0;

  background: var(--overlay);

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.25s ease;

  z-index: 900;
}

.grad-overlay.is-visible {
  display: block;

  opacity: 1;
  pointer-events: auto;
}


/* --------------------------------------------------
Footer
-------------------------------------------------- */

.site-footer {
  width: 100%;

  margin-top: 3rem;
  padding: 1.5rem 1rem;

  border-top: 1px solid var(--border);

  font-size: 0.9rem;

  color: var(--footer-text);

  background:
    rgba(0, 0, 0, 0.18);

  text-align: center;
}

.site-footer p {
  margin: 0.25rem 0;
}

.footer-nav {
  margin-top: 0.5rem;
}

.footer-nav a {
  margin: 0 0.5rem;

  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--primary);
}


/* --------------------------------------------------
Mobile Navigation
-------------------------------------------------- */

@media (max-width: 700px) {

  .site-header .container {
    flex-direction: column;
    flex-wrap: wrap;

    gap: 1rem;
  }

  .site-brand .logo-img {
    height: 60px;
  }

  .main-nav {
    width: 100%;

    gap: 0.75rem 1rem;
  }

  .grad-menu-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;
  }

  .grad-navigation {
    position: fixed;

    top: 0;
    left: 0;

    width: 280px;
    max-width: 80vw;

    height: 100vh;

    padding: 2rem 1.5rem;

    background: var(--surface);

    box-shadow:
      3px 0 12px rgba(0, 0, 0, 0.5);

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 1rem;

    transform: translateX(-100%);

    z-index: 1000;
  }

  .grad-navigation.is-open {
    transform: translateX(0);
  }

  .grad-navigation a {
    color: var(--muted);

    text-decoration: none;

    font-size: 1.1rem;
  }

  .grad-navigation a:hover {
    color: var(--primary);
  }

  .search {
    width: 100%;

    margin-top: 0.5rem;
  }

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

  .widget {
    min-height: 180px;
  }

  .hero {
    padding-top: 2rem;
  }

  .hero-logo {
    width: min(100%, 420px);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button {
    width: 100%;
    max-width: 320px;
  }
}


/* --------------------------------------------------
Desktop Navigation
-------------------------------------------------- */

@media (min-width: 701px) {

  .grad-overlay {
    display: none !important;
  }

  .grad-navigation {
    position: static;

    display: flex;

    flex-direction: row;
    align-items: center;

    gap: 1rem;

    transform: none;

    width: auto;
    height: auto;

    padding: 0;

    background: transparent;

    box-shadow: none;
  }
}

/* --------------------------------------------------
Cloudflare Worker + Ably
---------------------------------------------------*/

.analysis-result {
  margin-top: 2.5rem;
}

.analysis-result-pending,
.analysis-result-error {
  padding: 1.5rem;
  border: 1px solid currentColor;
  border-radius: 0.5rem;
}

.analysis-result-pending {
  opacity: 0.8;
}

.analysis-result-error {
  border-color: #b00020;
}

.analysis-report {
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 0.75rem;
  overflow: hidden;
}

.analysis-report-header {
  padding: 2rem;
  border-bottom: 1px solid currentColor;
}

.analysis-report-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.analysis-report-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  overflow-wrap: anywhere;
}

.analysis-report-url {
  margin: 0.75rem 0 0;
  overflow-wrap: anywhere;
  opacity: 0.7;
  font-family: monospace;
  font-size: 0.9rem;
}

.analysis-score {
  padding: 2.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid currentColor;
}

.analysis-score-label {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.analysis-score-value {
  line-height: 1;
}

.analysis-score-value strong {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
}

.analysis-score-value span {
  font-size: 1.2rem;
  opacity: 0.6;
}

.analysis-score-status {
  margin: 1rem 0 0;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.analysis-section {
  padding: 2rem;
  border-bottom: 1px solid currentColor;
}

.analysis-section h3 {
  margin: 0;
  font-size: 1.35rem;
}

.analysis-section-description {
  margin: 0.5rem 0 1.5rem;
  opacity: 0.7;
  line-height: 1.6;
}

.analysis-findings {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analysis-finding {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  line-height: 1.5;
}

.analysis-finding-marker {
  flex: 0 0 auto;
  width: 1.5rem;
  font-weight: 700;
}

.analysis-finding-pass .analysis-finding-marker {
  color: #16733a;
}

.analysis-finding-fail .analysis-finding-marker {
  color: #b00020;
}

.analysis-check-list {
  display: grid;
  gap: 0;
}

.analysis-check-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid currentColor;
  line-height: 1.4;
}

.analysis-check-row:first-child {
  padding-top: 0;
}

.analysis-check-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.analysis-check-value {
  flex: 0 0 auto;
  font-weight: 700;
  text-align: right;
}

.analysis-check-pass {
  color: #16733a;
}

.analysis-check-fail {
  color: #b00020;
}

.analysis-recommendations {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.6;
}

.analysis-technical {
  padding: 1.25rem 2rem;
}

.analysis-technical summary {
  cursor: pointer;
  font-weight: 700;
}

.analysis-technical-content {
  margin-top: 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.analysis-technical-content p {
  margin: 0.4rem 0;
}

.analysis-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .analysis-report-header,
  .analysis-score,
  .analysis-section {
    padding: 1.5rem;
  }

  .analysis-technical {
    padding: 1rem 1.5rem;
  }

  .analysis-check-row {
    display: grid;
    gap: 0.35rem;
  }

  .analysis-check-value {
    text-align: left;
  }
}
