/* ============================================================
   Fletch's Portal — Stylesheet
   Keep this file in the same folder as index.html
   ============================================================ */

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

/* ── Design tokens ── */
:root {
  --bg:         #080c10;
  --surface:    #0d1420;
  --surface2:   #111b2a;
  --border:     rgba(80,140,220,0.15);
  --glow-blue:  #4a9eff;
  --glow-amber: #f0a020;
  --glow-green: #38d98a;
  --glow-purple:#a060ff;
  --glow-red:   #ff5566;
  --text:       #c8daf0;
  --text-muted: #5a7a9a;
  --accent:     #2a4a7a;
}

/* ── Base ── */
html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  overflow-x: hidden;
}

/* Star field */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(180,210,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(180,210,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 50% 10%, rgba(180,210,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 80%, rgba(180,210,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 35%, rgba(180,210,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 85%, rgba(180,210,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 65%, rgba(180,210,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 42% 45%, rgba(180,210,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 25%, rgba(180,210,255,0.4) 0%, transparent 100%),
    radial-gradient(2px 2px at 78% 55%, rgba(200,220,255,0.3) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(40,80,140,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40,80,140,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

/* ── Header ── */
header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.site-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #e8f2ff;
  text-shadow: 0 0 40px rgba(74,158,255,0.4), 0 0 80px rgba(74,158,255,0.15);
  line-height: 1.1;
}

.site-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

.divider {
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(74,158,255,0.5), transparent);
  margin: 1.2rem auto 0;
}

/* ── Tile grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.75rem;
  max-width: 1100px;
  width: 100%;
}

@media (max-width: 900px) {
  .grid        { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weather-col { flex-direction: row; }
}

@media (max-width: 500px) {
  .grid        { grid-template-columns: 1fr; }
  .weather-col { flex-direction: column; }
}

/* Weather column — two stacked tiles sharing one grid cell */
.weather-col {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Small tile variant (used inside .weather-col) */
.tile-sm                  { padding: 1.4rem 1rem 1.2rem; gap: 0.75rem; flex: 1; }
.tile-sm .icon-wrap       { width: 72px; height: 72px; }
.tile-sm .icon-wrap svg   { width: 42px; height: 42px; }
.tile-sm .tile-label      { font-size: 0.85rem; }
.tile-sm .tile-desc       { font-size: 0.72rem; }

/* ── Tile base ── */
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 1.5rem 2rem;
  gap: 1.25rem;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.tile:hover        { transform: translateY(-6px) scale(1.01); background: var(--surface2); }
.tile:hover::before{ opacity: 1; }
.tile:active       { transform: translateY(-2px) scale(0.99); }

/* ── Tile colour variants ── */
/* To add a new colour: copy one block, pick a name, update the three rgba values */

.tile-blue   { --c: var(--glow-blue); }
.tile-blue:hover          { border-color: rgba(74,158,255,0.5); }
.tile-blue::before        { background: radial-gradient(circle at 50% 0%, rgba(74,158,255,0.07) 0%, transparent 70%); }
.tile-blue:hover .icon-wrap { box-shadow: 0 0 20px rgba(74,158,255,0.12), 0 0 0 4px rgba(74,158,255,0.05); }
.tile-blue:hover .tile-desc { color: rgba(74,158,255,0.7); }

.tile-amber  { --c: var(--glow-amber); }
.tile-amber:hover         { border-color: rgba(240,160,32,0.5); }
.tile-amber::before       { background: radial-gradient(circle at 50% 0%, rgba(240,160,32,0.07) 0%, transparent 70%); }
.tile-amber:hover .icon-wrap{ box-shadow: 0 0 20px rgba(240,160,32,0.15), 0 0 0 4px rgba(240,160,32,0.05); }
.tile-amber:hover .tile-desc{ color: rgba(240,160,32,0.7); }

.tile-green  { --c: var(--glow-green); }
.tile-green:hover         { border-color: rgba(56,217,138,0.5); }
.tile-green::before       { background: radial-gradient(circle at 50% 0%, rgba(56,217,138,0.07) 0%, transparent 70%); }
.tile-green:hover .icon-wrap{ box-shadow: 0 0 20px rgba(56,217,138,0.15), 0 0 0 4px rgba(56,217,138,0.05); }
.tile-green:hover .tile-desc{ color: rgba(56,217,138,0.7); }

.tile-purple { --c: var(--glow-purple); }
.tile-purple:hover        { border-color: rgba(160,96,255,0.5); }
.tile-purple::before      { background: radial-gradient(circle at 50% 0%, rgba(160,96,255,0.07) 0%, transparent 70%); }
.tile-purple:hover .icon-wrap{ box-shadow: 0 0 20px rgba(160,96,255,0.15), 0 0 0 4px rgba(160,96,255,0.05); }
.tile-purple:hover .tile-desc{ color: rgba(160,96,255,0.7); }

.tile-red    { --c: var(--glow-red); }
.tile-red:hover           { border-color: rgba(255,85,102,0.5); }
.tile-red::before         { background: radial-gradient(circle at 50% 0%, rgba(255,85,102,0.07) 0%, transparent 70%); }
.tile-red:hover .icon-wrap{ box-shadow: 0 0 20px rgba(255,85,102,0.15), 0 0 0 4px rgba(255,85,102,0.05); }
.tile-red:hover .tile-desc{ color: rgba(255,85,102,0.7); }

.tile-teal   { --c: #20c0d0; }
.tile-teal:hover          { border-color: rgba(32,192,208,0.5); }
.tile-teal::before        { background: radial-gradient(circle at 50% 0%, rgba(32,192,208,0.07) 0%, transparent 70%); }
.tile-teal:hover .icon-wrap{ box-shadow: 0 0 20px rgba(32,192,208,0.15), 0 0 0 4px rgba(32,192,208,0.05); }
.tile-teal:hover .tile-desc{ color: rgba(32,192,208,0.7); }

/* ── Icon circle ── */
.icon-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tile:hover .icon-wrap { border-color: var(--c); }

.icon-wrap svg { width: 64px; height: 64px; }

/* ── Tile text ── */
.tile-label {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #c8daf0;
  text-align: center;
  line-height: 1.3;
  transition: color 0.25s ease;
}

.tile:hover .tile-label { color: #fff; }

.tile-desc {
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  transition: color 0.25s ease;
}

/* ── Badge (Foundry server labels) ── */
.badge {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(160,96,255,0.15);
  border: 1px solid rgba(160,96,255,0.3);
  color: rgba(160,96,255,0.9);
}
