/* ==========================================================================
   Rifat's Website — shared stylesheet
   Modern dark theme, keeps the original neon-teal (#00ffcc) identity.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #070b14;
  --bg-2: #0c1322;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(0, 255, 204, 0.35);

  --accent: #00ffcc;
  --accent-dim: rgba(0, 255, 204, 0.14);
  --accent-2: #7c5cff;
  --accent-2-dim: rgba(124, 92, 255, 0.16);

  --text: #e9eefc;
  --muted: #97a3bd;
  --danger: #ff5c7a;

  --font: "Space Grotesk", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --mono: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;

  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1080px;

  --shadow-glow: 0 0 28px rgba(0, 255, 204, 0.22);
  --shadow-card: 0 14px 44px rgba(0, 0, 0, 0.45);

  --nav-h: 68px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(38rem 30rem at 12% -6%, rgba(0, 255, 204, 0.14), transparent 60%),
    radial-gradient(42rem 34rem at 88% 8%, rgba(124, 92, 255, 0.15), transparent 60%),
    radial-gradient(50rem 44rem at 50% 118%, rgba(0, 255, 204, 0.07), transparent 62%),
    var(--bg);
  pointer-events: none;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #6dffe0;
}

ul {
  list-style: none;
}

::selection {
  background: rgba(0, 255, 204, 0.28);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
}

.section {
  padding: 5.5rem 1.25rem;
}

.section-head {
  max-width: var(--maxw);
  margin: 0 auto 2.6rem;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
}

.section-head p {
  color: var(--muted);
  margin-top: 0.6rem;
  max-width: 56ch;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1.25rem;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.72);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.logo .logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1rem;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  gap: 0.35rem;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  cursor: pointer;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 20px;
  transform: rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100svh - var(--nav-h));
  padding: 4.5rem 1.25rem 3rem;
  position: relative;
}

.hero .eyebrow {
  justify-content: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  font-weight: 700;
  animation: heroGlow 3.2s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from {
    text-shadow: 0 0 14px rgba(0, 255, 204, 0.35);
  }
  to {
    text-shadow: 0 0 42px rgba(0, 255, 204, 0.75), 0 0 8px rgba(0, 255, 204, 0.5);
  }
}

.hero-sub {
  margin-top: 1.1rem;
  max-width: 52ch;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--muted);
}

.hero-sub strong {
  color: var(--text);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-top: 2.2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-primary {
  background: linear-gradient(92deg, var(--accent), #35e6ff);
  color: #03221c;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: #03221c;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.hero-meta {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.clock-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-glow);
}

.clock-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.scroll-hint {
  position: absolute;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  animation: bob 2s ease-in-out infinite;
}

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

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--muted);
  font-size: 0.94rem;
}

.card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.card .card-link::after {
  content: "→";
  transition: transform 0.2s ease;
}

.card:hover .card-link::after {
  transform: translateX(4px);
}

/* ---------- About preview / page ---------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.about-text p strong {
  color: var(--text);
}

.photo-frame {
  position: relative;
  max-width: 380px;
  margin: 0 auto;
}

.photo-frame::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: blur(16px);
  opacity: 0.35;
  z-index: -1;
}

.photo-frame img {
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}

.photo-caption {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  box-shadow: var(--shadow-glow);
}

/* ---------- Skills ---------- */
.skill-group h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-bottom: 0.9rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.chip {
  font-size: 0.88rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  background: var(--accent-dim);
  transform: translateY(-2px);
}

/* ---------- Projects ---------- */
.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-status {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.project-status.live {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--accent-dim);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.project-tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

/* ---------- Social links ---------- */
.socials {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.socials a:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  color: var(--accent);
}

.socials svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: start;
}

/* Info column */
.contact-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateX(4px);
}

.contact-item .card-icon {
  flex-shrink: 0;
  margin-bottom: 0;
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

.contact-item:hover .card-icon {
  box-shadow: var(--shadow-glow);
}

.contact-item h3 {
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.contact-item p,
.contact-item a {
  color: var(--muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.contact-item a {
  transition: color 0.2s ease;
}

.contact-item a:hover {
  color: var(--accent);
}

/* Social chips inside the contact info column stay left-aligned */
.contact-item .socials {
  justify-content: flex-start;
  gap: 0.6rem;
}

.contact-item .socials a {
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
  color: var(--text);
}

/* Form */
#contact-form {
  position: relative;
  overflow: hidden;
  padding: 1.8rem;
}

/* Accent bar along the top edge of the form card */
#contact-form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  opacity: 0.85;
}

/* Keep the form steady while typing — no hover lift */
#contact-form.reveal.visible:hover {
  transform: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.05rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea {
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  caret-color: var(--accent);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 130px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(151, 163, 189, 0.6);
}

.field input:hover,
.field textarea:hover {
  border-color: var(--border-strong);
}

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

/* Visible keyboard focus ring (box-shadow glow) */
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px rgba(0, 255, 204, 0.35);
}

.field .error-msg {
  color: var(--danger);
  font-size: 0.8rem;
  display: none;
}

.field.invalid input,
.field.invalid textarea {
  border-color: var(--danger);
}

.field.invalid input:focus-visible,
.field.invalid textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 92, 122, 0.32);
}

.field.invalid .error-msg {
  display: block;
}

.form-status {
  display: none;
  margin-top: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.form-status.success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--border-strong);
}

.form-status.success::before {
  content: "\2713"; /* ✓ */
  font-weight: 700;
}

.form-status.error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--danger);
  background: rgba(255, 92, 122, 0.1);
  border: 1px solid rgba(255, 92, 122, 0.35);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.6);
  padding: 2.6rem 1.25rem 2rem;
  margin-top: 3rem;
}

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

.footer-inner p {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner .clock-chip {
  box-shadow: none;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
}

/* ---------- Reveal-on-scroll animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.25rem;
    background: rgba(7, 11, 20, 0.96);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 1.25rem 1.1rem;
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.7rem 1rem;
  }

  .split,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-item {
    padding: 1rem;
  }

  #contact-form {
    padding: 1.5rem;
  }

  .photo-frame {
    order: -1;
  }

  .hero {
    min-height: calc(100svh - var(--nav-h));
  }
}

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

  .section {
    padding: 4rem 1.25rem;
  }
}

/* ---------- Reduced motion ---------- */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
