/* ============================================================
   dpanosian.com — CORE CHROME
   Header, footer, address, social row. The design layer
   (lapis.css) redefines the tokens below and draws the ground
   and the name; everything structural lives here.
   ============================================================ */
:root{
  /* the design layer overrides these */
  --bg:#f1efe9;
  --fg:#14161b;
  --mute:#8e8a82;
  --line:rgb(20 22 27 / .16);
  --accent:#14161b;
  --on-accent:#f1efe9;
  --surface:#14161b;
  --on-surface:#f1efe9;

  --ease:cubic-bezier(.16,1,.3,1);
  --gutter:clamp(1.1rem,3.5vw,2.5rem);
  --err:#d0705f;
}

*,*::before,*::after{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family:"Inter",system-ui,sans-serif;
  overflow:hidden; -webkit-font-smoothing:antialiased;
  transition:background .6s var(--ease), color .6s var(--ease);
}
button{font:inherit; color:inherit; background:none; border:0; cursor:pointer}
a{color:inherit; text-decoration:none}
:focus{outline:none}
:focus-visible{outline:2px solid var(--accent); outline-offset:4px}
::selection{background:var(--accent); color:var(--on-accent)}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- shell ---------- */
.shell{
  position:relative; z-index:10;
  height:100%; display:grid; grid-template-rows:auto 1fr auto;
  padding:var(--gutter);
}

/* ---------- header ----------
   Fixed left-to-right structure in every language: nothing here
   carries meaning that depends on reading order. */
.hd{
  display:grid; grid-template-columns:1fr auto 1fr;
  align-items:center; gap:1rem; direction:ltr;
}
.hd .mark{justify-self:start}
.hd .side{justify-self:end}
.mark{font-size:.66rem; letter-spacing:.26em; text-transform:uppercase; color:var(--mute)}
@media (max-width:540px){
  .hd{grid-template-columns:auto 1fr auto}
  .mark{display:none}
}

.langs{display:flex; gap:1.35rem; justify-self:center; direction:ltr}
.langs button{
  position:relative; font-size:.66rem; letter-spacing:.2em;
  text-transform:uppercase; color:var(--mute);
  transition:color .4s var(--ease);
}
.langs button:hover{color:var(--fg)}
.langs button[aria-pressed="true"]{color:var(--accent)}
.langs button::after{
  content:""; position:absolute; left:0; right:0; bottom:-5px; height:2px;
  background:var(--accent); transform:scaleX(0); transform-origin:left;
  transition:transform .5s var(--ease);
}
.langs button[aria-pressed="true"]::after{transform:scaleX(1)}

.tog{
  width:30px; height:30px; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:999px; color:var(--mute);
  transition:color .35s var(--ease), border-color .35s var(--ease);
}
.tog:hover{color:var(--fg); border-color:var(--accent)}
.tog svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.tog .moon{display:none}
:root[data-scheme="dark"] .tog .sun{display:none}
:root[data-scheme="dark"] .tog .moon{display:block}

/* ---------- centre ---------- */
.mid{display:grid; align-content:center; justify-items:center; gap:clamp(1.9rem,6vh,3.4rem)}

/* ---------- footer ----------
   Three slots — year, social, address — laid out left to right in
   every language, because none of them carries reading order. On a
   phone the social row moves to its own line above the other two. */
.ft{
  display:grid; direction:ltr;
  grid-template-columns:1fr auto 1fr;
  grid-template-areas:"yr so ml";
  align-items:baseline; gap:.75rem 1rem;
  font-size:.66rem; letter-spacing:.14em; text-transform:uppercase; color:var(--mute);
}
.ft .yr{grid-area:yr; justify-self:start}
.ft .social{grid-area:so; justify-self:center}
.ft .mail{grid-area:ml; justify-self:end}
@media (max-width:640px){
  .ft{
    grid-template-columns:auto auto;
    grid-template-areas:"so so" "yr ml";
    justify-content:space-between;
  }
}

/* ---------- social ---------- */
.social{
  display:flex; align-items:baseline; gap:.55rem; flex-wrap:wrap;
  justify-content:center; direction:ltr;
}
.social[hidden]{display:none}
.social a{
  position:relative; color:var(--mute);
  letter-spacing:.14em; text-transform:uppercase;
  transition:color .35s var(--ease);
}
.social a:hover{color:var(--accent)}
.social a::after{
  content:""; position:absolute; left:0; right:0; bottom:-3px; height:1px;
  background:currentColor; transform:scaleX(0); transform-origin:right;
  transition:transform .5s var(--ease);
}
.social a:hover::after{transform:scaleX(1); transform-origin:left}
.social .sep{font-weight:400; opacity:.45}

.mail{
  position:relative; cursor:pointer; direction:ltr;
  text-transform:none; letter-spacing:.04em;
  color:var(--mute); transition:color .3s var(--ease);
}
.mail:hover{color:var(--accent)}
.mail::after{
  content:""; position:absolute; inset-inline:0; bottom:-3px; height:1px;
  background:currentColor; transform:scaleX(0); transform-origin:right;
  transition:transform .5s var(--ease);
}
.mail:hover::after{transform:scaleX(1); transform-origin:left}
.mail .tip{
  position:absolute; inset-inline-start:0; bottom:calc(100% + .5rem);
  padding:.14rem .45rem; border-radius:3px;
  background:var(--accent); color:var(--on-accent);
  font-size:.6rem; letter-spacing:0; white-space:nowrap;
  opacity:0; transform:translateY(3px);
  transition:opacity .3s var(--ease), transform .3s var(--ease);
}
.mail[data-copied="true"] .tip{opacity:1; transform:none}

/* ---------- the call to write ----------
   The button opens the form. If there is no key to seal with, it
   falls back to a plain message and the line underneath carries
   the address. It reserves its height from the start, so nothing
   shifts when it appears. */
.call{display:grid; justify-items:center; gap:.55rem}
.hint{
  margin:0; min-height:1.2em;
  font-size:.66rem; letter-spacing:.1em; color:var(--mute);
  direction:ltr; user-select:all;
  opacity:0; transform:translateY(3px);
  transition:opacity .5s var(--ease), transform .5s var(--ease);
}
.hint[data-show="true"]{opacity:1; transform:none}

/* ---------- form ----------
   The design layer positions and reveals this however it likes;
   only the look of the fields is shared. */
.dpform{width:min(94vw,32rem)}
.dpform h2{
  margin:0 0 2rem;
  font-size:clamp(1.4rem,4vw,2.1rem); font-weight:400; letter-spacing:-.02em;
}
.f{position:relative; margin-bottom:1.9rem}
.f input,.f textarea{
  width:100%; padding:.5rem 0 .6rem;
  font:inherit; font-size:1.02rem; color:var(--on-surface);
  background:transparent; border:0;
  border-bottom:1px solid rgb(from var(--on-surface) r g b / .24);
  border-radius:0; resize:none;
  transition:border-color .4s var(--ease);
}
.f textarea{min-height:4.6rem; line-height:1.6}
.f label{
  position:absolute; inset-inline-start:0; top:.5rem;
  font-size:1.02rem; color:rgb(from var(--on-surface) r g b / .45);
  pointer-events:none; transform-origin:left;
  transition:transform .45s var(--ease), color .45s var(--ease);
}
html[dir="rtl"] .f label{transform-origin:right}
.f input:focus + label,.f textarea:focus + label,
.f input:not(:placeholder-shown) + label,
.f textarea:not(:placeholder-shown) + label{
  transform:translateY(-1.45rem) scale(.7);
  color:var(--on-surface);
}
.f .u{
  position:absolute; inset-inline:0; bottom:0; height:2px;
  background:var(--on-surface);
  transform:scaleX(0); transform-origin:left;
  transition:transform .55s var(--ease);
}
html[dir="rtl"] .f .u{transform-origin:right}
.f input:focus ~ .u,.f textarea:focus ~ .u{transform:scaleX(1)}
.f[data-bad="true"] input,.f[data-bad="true"] textarea{border-bottom-color:var(--err)}
/* the field only a robot fills in */
.hp{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

.dprow{display:flex; align-items:center; gap:1.3rem; flex-wrap:wrap}
.send{
  padding:.72rem 1.8rem; border-radius:999px;
  background:var(--on-surface); color:var(--surface);
  font-size:.9rem; font-weight:500;
  transition:opacity .3s var(--ease), transform .25s var(--ease);
}
.send:hover{opacity:.86}
.send:active{transform:scale(.985)}
.send[disabled]{opacity:.4; cursor:default}
.back{
  font-size:.76rem; letter-spacing:.16em; text-transform:uppercase;
  color:rgb(from var(--on-surface) r g b / .5);
  transition:color .3s var(--ease);
}
.back:hover{color:var(--on-surface)}

/* the quiet promise under the button */
.dpseal{
  margin:1.3rem 0 0; font-size:.72rem; line-height:1.5;
  color:rgb(from var(--on-surface) r g b / .45);
  padding-inline-start:1.1rem; position:relative;
}
.dpseal::before{
  content:""; position:absolute; inset-inline-start:0; top:.42em;
  width:.42rem; height:.42rem; border-radius:50%;
  background:currentColor; opacity:.7;
}
.dpstate{
  margin:.8rem 0 0; min-height:1.3em; font-size:.82rem;
  color:rgb(from var(--on-surface) r g b / .62);
  opacity:0; transition:opacity .4s var(--ease);
}
.dpstate[data-show="true"]{opacity:1}
.dpstate[data-kind="bad"]{color:var(--err)}

/* ---------- entrance ---------- */
.shell{opacity:0; transition:opacity 1s var(--ease) .2s}
.ready .shell{opacity:1}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important; animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
  .shell{opacity:1}
}

/* ---------- opt-in cursor (DP.cursor()) ---------- */
.dpring{
  position:fixed; top:0; left:0; z-index:60;
  width:22px; height:22px; margin:-11px 0 0 -11px;
  border:1px solid var(--accent); border-radius:50%;
  opacity:0; pointer-events:none;
  transition:opacity .6s var(--ease), width .4s var(--ease),
             height .4s var(--ease), margin .4s var(--ease), background .4s var(--ease);
  will-change:transform;
}
.dpdot{
  position:fixed; top:0; left:0; z-index:61;
  width:3px; height:3px; margin:-1.5px 0 0 -1.5px;
  border-radius:50%; background:var(--accent);
  opacity:0; pointer-events:none;
  transition:opacity .6s var(--ease);
  will-change:transform;
}
.dpring.on,.dpdot.on{opacity:1}
.dpring.hot{width:34px;height:34px;margin:-17px 0 0 -17px;background:rgb(from var(--accent) r g b / .08)}
body.nocursor{cursor:none}
body.nocursor button{cursor:none}
@media (hover:none){ .dpring,.dpdot{display:none} body.nocursor,body.nocursor button{cursor:auto} }
