/* =====================================================
   PHREN GAMES — CORPORATE LANDING PAGE
   Design system (locked):
     background:      #000000
     primary text:    #FFFFFF
     secondary text:  soft grey
     accents:         subtle RGB (from logo) on focus/hover only
     typeface:        Inter
   ===================================================== */

/* -----------------------------------------------------
   1. Design tokens
   ----------------------------------------------------- */
:root {
  --color-bg: #000000;
  --color-text-primary: #ffffff;
  --color-text-secondary: #9a9a9a;
  --color-border: #2a2a2a;
  --color-border-strong: #444444;

  /* Subtle RGB accents sampled from the official logo.
     Used ONLY for focus / hover states — never as fills or gradients. */
  --accent-red: #ff3b3b;
  --accent-green: #2ee66b;
  --accent-blue: #3b7bff;

  --color-error: #ff5c5c;
  --color-success: #ffffff;

  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  --content-max-width: 720px;
  --page-max-width: 1200px;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 9rem;

  --radius: 4px;
  --transition-fast: 150ms ease;
  --transition-medium: 400ms ease;
}

/* -----------------------------------------------------
   2. Reset / base
   ----------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: inherit;
}

/* Visible focus state for all interactive elements (accessibility requirement) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* -----------------------------------------------------
   3. Layout helpers
   ----------------------------------------------------- */
main {
  display: block;
}

/* -----------------------------------------------------
   4. Hero
   ----------------------------------------------------- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(3rem, 8vh, 6rem) clamp(1rem, 4vw, 1.5rem);
  text-align: center;
}

.hero__inner {
  width: 100%;
  max-width: var(--content-max-width);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__logo {
  width: clamp(220px, 48vw, 320px);
  max-width: 100%;
  height: auto;
  margin-bottom: var(--space-4);
}

.hero__eyebrow {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.hero__slogan {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--color-text-primary);
  max-width: 18ch;
}

/* Logo fade-in (permitted animation #1) */
.fade-in {
  animation: fadeIn var(--transition-medium) ease forwards;
}

.hero__logo.fade-in {
  animation-delay: 100ms;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
  }
}

/* -----------------------------------------------------
   5. Contact section
   ----------------------------------------------------- */
.contact {
  padding: clamp(4rem, 8vw, 6rem) clamp(1rem, 4vw, 1.5rem) clamp(5rem, 10vw, 9rem);
  border-top: 1px solid var(--color-border);
}

.contact__inner {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.contact__heading {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
  text-align: center;
}

/* -----------------------------------------------------
   6. Form
   ----------------------------------------------------- */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.required {
  color: var(--color-text-secondary);
}

input[type="text"],
input[type="email"],
textarea {
  background-color: #000000;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color var(--transition-fast);
  width: 100%;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
  color: #5c5c5c;
}

input[type="text"]:hover,
input[type="email"]:hover,
textarea:hover {
  border-color: var(--color-border-strong);
}

/* Subtle RGB accent on focus — one accent colour (blue), used consistently. */
input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

textarea {
  resize: vertical;
  min-height: 140px;
  max-height: 60vh;
}

/* Invalid state does not rely on colour alone — paired with visible error text below */
.field.invalid input,
.field.invalid textarea {
  border-color: var(--color-error);
}

.field-error {
  display: block;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: var(--color-error);
  margin-top: var(--space-1);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.char-counter {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  margin-top: var(--space-1);
}

.char-counter.limit-reached {
  color: var(--accent-red);
}

/* -----------------------------------------------------
   7. Submit button
   ----------------------------------------------------- */
.submit-button {
  appearance: none;
  background-color: var(--color-text-primary);
  color: #000000;
  border: 1px solid var(--color-text-primary);
  border-radius: var(--radius);
  padding: 0.875rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: var(--space-1);
  min-height: 48px;
}

/* Subtle RGB accent on hover — thin ring rather than colour fill */
.submit-button:hover {
  box-shadow: 0 0 0 3px rgba(59, 123, 255, 0.25);
}

.submit-button:active {
  transform: translateY(1px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.65;
  box-shadow: none;
}

.website-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-status {
  border: 1px solid var(--color-error);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  color: var(--color-error);
  font-size: 0.875rem;
  text-align: center;
}

/* -----------------------------------------------------
   8. Consent line
   ----------------------------------------------------- */
.consent {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.consent a {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.consent a:hover {
  color: var(--accent-green);
}

/* -----------------------------------------------------
   9. Success message
   ----------------------------------------------------- */
.form-success {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: var(--space-3);
  text-align: center;
  color: var(--color-success);
  margin-top: var(--space-3);
}

.form-success p + p {
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
  font-size: 0.9375rem;
}

/* -----------------------------------------------------
   10. Footer
   ----------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) max(var(--space-3), env(safe-area-inset-right)) max(var(--space-3), env(safe-area-inset-bottom)) max(var(--space-3), env(safe-area-inset-left));
}

.site-footer__inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  text-align: center;
}

.site-footer a {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.site-footer a:hover {
  color: var(--accent-blue);
}

.site-footer__copyright {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

/* -----------------------------------------------------
   11. Privacy page (privacy.html)
   ----------------------------------------------------- */
.privacy-page {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 4rem) clamp(1rem, 4vw, 1.5rem) clamp(4rem, 9vw, 6rem);
  overflow-wrap: anywhere;
}

.privacy-page__back {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-bottom: var(--space-4);
  transition: color var(--transition-fast);
}

.privacy-page__back:hover {
  color: var(--accent-blue);
}

.privacy-page h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.privacy-page h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.privacy-page h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.privacy-page h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
  color: var(--color-text-primary);
}

.privacy-page p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  max-width: 68ch;
}

.privacy-page ul {
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-2);
  padding-left: 1.25rem;
}

.privacy-page ul ul {
  margin-top: var(--space-1);
}

.privacy-page li {
  margin-bottom: var(--space-1);
  max-width: 68ch;
}

.privacy-page strong {
  color: var(--color-text-primary);
}

.privacy-page a {
  color: var(--color-text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-page a:hover {
  color: var(--accent-blue);
}

/* -----------------------------------------------------
   12. Responsive
   ----------------------------------------------------- */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: max(100dvh, 560px);
  }

  .hero__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.09em;
  }

  .hero__slogan {
    font-size: clamp(1.65rem, 8vw, 2.2rem);
  }

  .site-footer__inner {
    flex-direction: column;
  }

  .privacy-page h1 {
    font-size: clamp(1.5rem, 8vw, 1.75rem);
  }

  .privacy-page h2 {
    margin-top: var(--space-4);
  }
}

@media (max-width: 380px) {
  .hero__logo {
    width: 220px;
  }

  .field-meta {
    flex-direction: column;
    gap: 0;
  }

  .char-counter {
    align-self: flex-end;
  }
}

@media (max-height: 620px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }

  .hero__logo {
    width: 180px;
    margin-bottom: var(--space-2);
  }
}

@media (min-width: 1600px) {
  .hero__slogan {
    font-size: 3rem;
  }
}
