/* ==========================================================================
   Twilight Mesa — global styles
   Minimalist, dark, generous whitespace. Edit colors below to re-theme.
   ========================================================================== */

:root {
  --bg: #0b0b0c;
  --bg-alt: #131315;
  --text: #ede9e3;
  --text-dim: #8f8d88;
  --line: rgba(237, 233, 227, 0.16);
  --line-strong: rgba(237, 233, 227, 0.32);

  --sun-a: #f4b942;
  --sun-b: #e8543c;
  --moon-a: #7c8ce0;
  --moon-b: #9b5de5;

  --red: #e8543c;
  --green: #4caf7d;

  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --max: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* ---- Utility ---- */

.visually-hidden {
  position: absolute;
  left: -9999px;
}

.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Top nav ---- */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px clamp(24px, 5vw, 56px);
}

.site-nav .wordmark {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  opacity: 0.9;
}

.site-nav .nav-links a {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

.site-nav .nav-links a:hover {
  color: var(--text);
}

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

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 80px;
}

.hero .company-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 9vw, 88px);
  letter-spacing: 1px;
  margin: 36px 0 18px;
}

.hero .tagline {
  font-size: clamp(14px, 2vw, 17px);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}

.scroll-cue {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.6;
  transition: opacity 0.4s ease;
  animation: cue-bounce 2.4s ease-in-out infinite;
}

.scroll-cue.is-hidden {
  opacity: 0;
}

@keyframes cue-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---- Twilight mark (logo / motif) ---- */

.tm-mark {
  position: relative;
  width: var(--mark-size, 160px);
  height: var(--mark-size, 160px);
  margin: 0 auto;
}

.tm-mark .tm-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.tm-mark .tm-line {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 1px;
  background: var(--line-strong);
  transform: translateY(-50%);
}

.tm-mark .tm-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: background 0.6s ease, box-shadow 0.6s ease;
}

.tm-mark .tm-dot.is-sun {
  background: radial-gradient(circle at 32% 28%, var(--sun-a), var(--sun-b));
  box-shadow: 0 0 20px 2px rgba(232, 84, 60, 0.5);
}

.tm-mark .tm-dot.is-moon {
  background: radial-gradient(circle at 32% 28%, var(--moon-a), var(--moon-b));
  box-shadow: 0 0 20px 2px rgba(124, 140, 224, 0.5);
}

/* ---- Tiles ---- */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 60px clamp(24px, 5vw, 56px) 40px;
}

.tile {
  perspective: 1400px;
  height: 300px;
}

.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
}

.tile:hover .tile-inner,
.tile:focus-within .tile-inner,
.tile.is-flipped .tile-inner {
  transform: rotateY(180deg);
}

.tile-front,
.tile-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 32px;
}

.tile-front {
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
}

.tile-front .tile-icon {
  width: 44px;
  height: 44px;
  stroke: var(--text);
  fill: none;
  stroke-width: 1.3;
  opacity: 0.85;
}

.tile-front h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.5px;
  margin: 0;
}

.tile-back {
  background: var(--bg-alt);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.tile-back h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 4px;
}

.tile-back p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

.tile-back .portfolio-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tile-back .portfolio-links a {
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tile-back .portfolio-links a:hover {
  color: var(--sun-b);
  border-color: var(--sun-b);
}

.tile-back .portfolio-links .is-muted {
  font-size: 14px;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 2px;
  display: inline-block;
}

/* ---- Contact CTA (homepage) ---- */

.contact-cta {
  display: flex;
  justify-content: center;
  padding: 20px 24px 120px;
}

.btn {
  display: inline-block;
  padding: 15px 40px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

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

.site-footer {
  text-align: center;
  padding: 40px 24px 56px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-dim);
}

/* ---- Contact page ---- */

.contact-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 160px 24px 100px;
  text-align: center;
}

.contact-page h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 6vw, 52px);
  margin: 8px 0 12px;
}

.contact-page .lede {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 440px;
  margin: 0 0 48px;
  line-height: 1.6;
}

.contact-form {
  width: 100%;
  max-width: 440px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.field input,
.field textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  padding: 8px 2px;
  resize: vertical;
  transition: border-color 0.25s ease;
}

.field textarea {
  min-height: 96px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
}

.contact-form .submit-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 4px;
}

.contact-form button {
  font: inherit;
  cursor: pointer;
}

.form-status {
  font-size: 13px;
  color: var(--text-dim);
}

.form-status.is-success {
  color: var(--green);
}

.form-status.is-error {
  color: var(--red);
}

/* ---- Responsive ---- */

@media (max-width: 780px) {
  .tiles {
    grid-template-columns: 1fr;
  }

  .tile {
    height: 260px;
  }
}
