/* ===================================================================
   Oscar Berrigan — Portfolio
   Modern dark theme, single accent color, fully responsive.
   =================================================================== */

:root {
  --bg:        #0a0a0b;
  --bg-soft:   #121214;
  --surface:   #17171b;
  --border:    #2a2a30;
  --text:      #f5f5f7;
  --muted:     #a1a1aa;
  --accent:    #ff2733;
  --accent-2:  #ff5a63;
  --radius:    16px;
  --shadow:    0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --container:  1080px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

h1, h2, h3, .nav__brand { font-family: "Sora", sans-serif; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.accent { color: var(--accent); }
.dim { color: var(--muted); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 12px; --pad-x: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
              box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 30px -12px var(--accent);
}
.btn--primary:hover { box-shadow: 0 18px 40px -12px var(--accent); }

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

.btn--sm { --pad-y: 8px; --pad-x: 16px; font-size: 0.85rem;
  border-color: var(--accent); color: var(--accent); }
.btn--sm:hover { background: rgba(255, 39, 51, 0.12); }

.btn--lg { --pad-y: 15px; --pad-x: 34px; font-size: 1.05rem; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10, 10, 11, 0.6);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.85);
  border-bottom-color: var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.nav__brand { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a:not(.btn) {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav__links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}
.nav__links a:not(.btn):hover,
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav__toggle span {
  width: 26px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  align-items: center;
  gap: 56px;
}
.hero__content { max-width: 760px; }
.hero__eyebrow {
  color: var(--accent);
  font-family: "Sora", sans-serif;
  font-weight: 500;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
.hero__name {
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.hero__tagline {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: -0.02em;
}
.hero__desc {
  color: var(--muted);
  max-width: 540px;
  margin-top: 24px;
  font-size: 1.05rem;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }
.hero__social { display: flex; gap: 20px; margin-top: 40px; }
.hero__social a {
  color: var(--muted);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.hero__social a:hover { color: var(--accent); transform: translateY(-3px); }

/* Hero profile picture */
.hero__photo {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hero__photo-frame {
  --size: clamp(200px, 22vw, 300px);
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 3px;
  box-shadow: var(--shadow);
}
.hero__photo-frame::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent));
  animation: spin 8s linear infinite;
  z-index: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero__photo-img,
.hero__photo-fallback {
  position: absolute;
  inset: 3px;
  z-index: 1;
  border-radius: 25px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  object-fit: cover;
  background: var(--bg-soft);
}
/* Fallback initials sit behind the image; shown when no photo is set */
.hero__photo-fallback {
  display: grid;
  place-items: center;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 4.5rem);
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: -0.02em;
  z-index: 0;
}
/* When the image is missing/broken, JS adds this class to hide the <img> */
.hero__photo-frame.no-img .hero__photo-img { display: none; }

.hero__photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
}
.hero__photo-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 39, 51, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 39, 51, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 39, 51, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 39, 51, 0); }
}

.hero__glow {
  position: absolute;
  top: -20%; right: -10%;
  width: 620px; height: 620px;
  background: radial-gradient(circle, rgba(255, 39, 51, 0.26), transparent 65%);
  filter: blur(30px);
  z-index: 1;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -25%; left: -15%;
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(255, 90, 99, 0.12), transparent 65%);
  filter: blur(30px);
  z-index: 1;
  pointer-events: none;
}

/* ---------- Sections ---------- */
.section { padding: 100px 0; position: relative; }
.section__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}
.section__num {
  color: var(--accent);
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  align-items: start;
}
.about__text p { color: var(--muted); margin-bottom: 18px; }
.about__text strong { color: var(--text); font-weight: 600; }

.about__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.about__avatar {
  width: 88px; height: 88px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-bottom: 22px;
}
.about__facts li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.about__facts li:last-child { border-bottom: 0; }
.about__facts span { font-size: 1.1rem; }

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              box-shadow 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.card__media {
  height: 150px;
  background: var(--thumb, var(--bg-soft));
  display: grid;
  place-items: center;
  position: relative;
}
.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 10, 11, 0.55));
}
.card__initial {
  position: relative;
  z-index: 1;
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.card__body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.card__title { font-size: 1.3rem; font-weight: 700; }
.card__links { display: flex; gap: 12px; }
.card__links a { color: var(--muted); transition: color 0.2s var(--ease), transform 0.2s var(--ease); }
.card__links a:hover { color: var(--accent); transform: translateY(-2px); }
.card__tagline { color: var(--text); font-weight: 500; margin-bottom: 10px; }
.card__desc { color: var(--muted); font-size: 0.94rem; margin-bottom: 18px; flex: 1; }

/* ---------- Tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 0.78rem;
  font-family: "Sora", sans-serif;
  font-weight: 500;
  color: #ff9ba1;
  background: rgba(255, 39, 51, 0.10);
  border: 1px solid rgba(255, 39, 51, 0.24);
  padding: 4px 12px;
  border-radius: 999px;
}
.tags--lg li { font-size: 0.9rem; padding: 8px 16px; }

/* ---------- Skills ---------- */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.skills__group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.skills__group:hover { border-color: var(--accent); transform: translateY(-4px); }
.skills__group h3 {
  font-size: 1.05rem;
  margin-bottom: 18px;
  color: var(--text);
}

/* ---------- Contact ---------- */
.section--contact { text-align: center; padding: 120px 0; }
.contact { max-width: 620px; }
.contact .section__num { display: block; margin-bottom: 12px; }
.contact__title { font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -0.02em; }
.contact__desc { color: var(--muted); margin: 20px auto 36px; font-size: 1.05rem; }
.contact__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 44px;
}
.contact__links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}
.contact__links a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 30px 0; }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero__content { max-width: 100%; }
  .hero__cta, .hero__social { justify-content: center; }
  .hero__desc { margin-inline: auto; }
  .hero__photo { order: -1; }
}

@media (max-width: 820px) {
  .about { grid-template-columns: 1fr; }
  .about__card { order: -1; }
}

@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: 70px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 20px 24px 28px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a:not(.btn) { padding: 10px 0; font-size: 1.05rem; width: 100%; }
  .nav__links .btn { margin-top: 8px; }
  .section { padding: 80px 0; }
}
