/* ============================================================
   Kyle Grare - "Graphite & Signal"
   Editorial-engineering personal site
   ============================================================ */

:root {
  /* palette */
  --bg:        #0b0b0d;
  --bg-2:      #ffffff0a;
  --bg-3:      #14141a;
  --line:      #ffffff14;
  --line-2:    #ffffff26;
  --ink:       #ece9e1;
  --ink-2:     #b3afa4;
  --ink-3:     #76736b;
  --accent:    #ff5c33;
  --accent-2:  #ffb38f;
  --accent-dim:#ff5c3322;

  /* type */
  --serif: "Newsreader", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* metrics */
  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* grain / atmosphere overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: screen;
}

/* soft glow top-left */
body::after {
  content: "";
  position: fixed;
  top: -20%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, #ff5c3318 0%, transparent 60%);
  filter: blur(40px);
}

::selection { background: var(--accent); color: #fff; }

a { color: inherit; text-decoration: none; }

/* ---------- layout helpers ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
  position: relative;
  z-index: 2;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 56px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.section-head .idx {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.015em;
  line-height: 1;
}
.section-head .meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

section { padding: clamp(80px, 11vw, 150px) 0; position: relative; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: #0b0b0dcc;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: 13px;
  padding-bottom: 13px;
}
.nav .brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.nav .brand .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}
.nav .links {
  display: flex;
  gap: 30px;
  align-items: center;
}
.nav .links a {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.25s var(--ease);
  position: relative;
}
.nav .links a .n { color: var(--accent); margin-right: 5px; font-size: 10px; }
.nav .links a:hover { color: var(--ink); }
.nav .links a.cta {
  color: var(--ink);
  border: 1px solid var(--line-2);
  padding: 7px 15px;
  border-radius: 100px;
  transition: all 0.25s var(--ease);
}
.nav .links a.cta:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.nav .menu-toggle { display: none; }

@media (max-width: 760px) {
  .nav .links a:not(.cta) { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
  padding-bottom: 70px;
}
.hero .status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 40px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.hero .status .live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 #4ade8099;
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 #4ade8066; }
  70% { box-shadow: 0 0 0 9px #4ade8000; }
  100% { box-shadow: 0 0 0 0 #4ade8000; }
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 11vw, 150px);
  line-height: 0.92;
  letter-spacing: -0.03em;
}
.hero h1 em {
  font-style: italic;
  color: var(--ink-2);
}
.hero .lede {
  max-width: 620px;
  margin-top: 38px;
  font-size: clamp(18px, 2.3vw, 23px);
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 300;
}
.hero .lede b { color: var(--ink); font-weight: 500; }
.hero .hero-foot {
  margin-top: 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 22px;
  border-radius: 100px;
  border: 1px solid var(--line-2);
  color: var(--ink);
  transition: all 0.3s var(--ease);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--accent); }
.btn:hover { border-color: var(--ink-2); }
.btn svg { width: 14px; height: 14px; }

/* hero quick stats strip */
.hero-stats {
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.hero-stats .stat {
  background: var(--bg);
  padding: 26px 24px;
}
.hero-stats .stat .num {
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1;
  letter-spacing: -0.02em;
}
.hero-stats .stat .num .accent { color: var(--accent); }
.hero-stats .stat .lab {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(30px, 6vw, 90px);
  align-items: start;
}
.about-grid .label-col .headshot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  color: var(--ink-2);
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-3);
  overflow: hidden;
}
/* fills the frame once a real photo is supplied via the <img> src */
.about-grid .label-col .headshot img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-grid .label-col .headshot img[src] { display: block; }
/* empty-state placeholder, hidden as soon as a photo is present */
.about-grid .label-col .headshot:has(img[src]) .headshot-ph { display: none; }
.headshot-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 18px;
  color: var(--ink-3);
}
.headshot-ph::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1.5px dashed var(--line-2);
  border-radius: 8px;
  pointer-events: none;
}
.headshot-ph svg { opacity: 0.5; }
.headshot-ph span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.about-grid .label-col .mono { display: block; margin-bottom: 20px; }
.about-grid .label-col .now {
  display: flex; flex-direction: column; gap: 18px;
  padding-top: 28px; margin-top: 28px;
  border-top: 1px solid var(--line);
}
.about-grid .now .row { display: flex; flex-direction: column; gap: 4px; }
.about-grid .now .row .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.about-grid .now .row .v { color: var(--ink); font-size: 15.5px; }
.about-prose p {
  font-family: var(--serif);
  font-size: clamp(21px, 2.7vw, 30px);
  line-height: 1.45;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.about-prose p + p { margin-top: 1em; }
.about-prose p .dim { color: var(--ink-3); }
.about-prose .signoff {
  margin-top: 40px;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  font-weight: 300;
}
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ============================================================
   EXPERIENCE
   ============================================================ */
.xp-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(20px, 5vw, 70px);
  padding: 42px 0;
  border-top: 1px solid var(--line);
  transition: background 0.4s var(--ease);
  position: relative;
}
.xp-item:last-child { border-bottom: 1px solid var(--line); }
.xp-item::before {
  content: "";
  position: absolute;
  left: -24px; right: -24px; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  border-radius: 12px;
  z-index: -1;
}
.xp-item:hover::before { opacity: 1; }
.xp-meta .period {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.xp-meta .loc {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.xp-body .role {
  font-family: var(--serif);
  font-size: clamp(23px, 3vw, 31px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.xp-body .company {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 15px;
  color: var(--accent-2);
}
.xp-body .company .arrow { transition: transform 0.3s var(--ease); }
.xp-item:hover .company .arrow { transform: translate(3px, -3px); }
.xp-body .desc {
  margin-top: 18px;
  max-width: 640px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.62;
  font-weight: 300;
}
.xp-body .tags {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.xp-body .tags span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 5px 11px;
  border-radius: 100px;
}
@media (max-width: 700px) {
  .xp-item { grid-template-columns: 1fr; gap: 14px; }
}

/* ============================================================
   WORK / PROJECTS
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.work-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  background: linear-gradient(180deg, #ffffff05, transparent);
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.work-card:hover { border-color: var(--line-2); transform: translateY(-3px); }
.work-card .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.work-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.015em;
  margin-top: 14px;
  line-height: 1.1;
}
.work-card p {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.6;
  font-weight: 300;
}
.work-card .wfoot {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  gap: 26px;
}
.work-card .wfoot .m .num {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.work-card .wfoot .m .lab {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}
.work-card.wide { grid-column: span 2; }
@media (max-width: 760px) {
  .work-grid { grid-template-columns: 1fr; }
  .work-card.wide { grid-column: span 1; }
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.skill-col { background: var(--bg); padding: 32px 30px; }
.skill-col .cat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.skill-col .cat::before {
  content: ""; width: 18px; height: 1px; background: var(--accent);
}
.skill-col ul { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.skill-col li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15.5px;
  color: var(--ink);
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.skill-col li:last-child { border-bottom: none; padding-bottom: 0; }
.skill-col li .lvl { font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
@media (max-width: 760px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact { text-align: left; }
.contact .big {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 8vw, 100px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.contact .big a {
  position: relative;
  transition: color 0.3s var(--ease);
}
.contact .big a:hover { color: var(--accent); }
.contact .sub {
  margin-top: 30px;
  max-width: 520px;
  color: var(--ink-2);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.55;
}
.contact .channels {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.contact .channels a {
  background: var(--bg);
  padding: 26px 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.3s var(--ease);
}
.contact .channels a:hover { background: var(--bg-3); }
.contact .channels a .k {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.contact .channels a .v {
  font-size: 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.contact .channels a:hover .v { color: var(--accent); }
.contact .channels a .arrow { transition: transform 0.3s var(--ease); margin-left: auto; }
.contact .channels a:hover .arrow { transform: translate(3px, -3px); color: var(--accent); }

/* footer */
.footer {
  padding: 40px var(--pad);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 2;
}
.footer .mono { font-size: 11px; }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
